Skip to content

Commit

Permalink
Added Archived Article count to Category Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
pe7er committed May 10, 2015
1 parent 1c0e496 commit e3ead0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions administrator/components/com_categories/models/categories.php
Expand Up @@ -286,6 +286,9 @@ protected function getListQuery()
$query->select('COUNT(DISTINCT cu.id) AS count_unpublished');
$query->join('LEFT', '#__content AS cu ON cu.catid = a.id AND cu.state = 0');

$query->select('COUNT(DISTINCT ca.id) AS count_archived');
$query->join('LEFT', '#__content AS ca ON ca.catid = a.id AND ca.state = 2');

$query->select('COUNT(DISTINCT ct.id) AS count_trashed');
$query->join('LEFT', '#__content AS ct ON ct.catid = a.id AND ct.state = -2');

Expand Down
Expand Up @@ -63,17 +63,18 @@
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<?php if ($component == 'com_content') : ?>
<th width="10%" class="nowrap center">
<th width="5%" class="nowrap center">
<i class="icon-publish"></i>
<span class="hidden-phone"><?php echo JText::_('COM_CATEGORY_HEADING_PUBLISHED_ITEMS'); ?></span>
</th>
<th width="10%" class="nowrap center">
<th width="5%" class="nowrap center">
<i class="icon-unpublish"></i>
<span class="hidden-phone"><?php echo JText::_('COM_CATEGORY_HEADING_UNPUBLISHED_ITEMS'); ?></span>
</th>
<th width="10%" class="nowrap center">
</th>
<th width="5%" class="nowrap center">
<i class="icon-archive"></i>
</th>
<th width="5%" class="nowrap center">
<i class="icon-trash"></i>
<span class="hidden-phone"><?php echo JText::_('COM_CATEGORY_HEADING_TRASHED_ITEMS'); ?></span>
</th>
<?php endif;?>
<th width="10%" class="nowrap hidden-phone">
Expand Down Expand Up @@ -190,6 +191,11 @@
. (int) $item->id . '&filter[published]=0' . '&filter[level]=' . (int) $item->level);?>">
<?php echo $item->count_unpublished; ?></a>
</td>
<td class="center btns">
<a class="badge <?php if ($item->count_archived > 0) echo "badge-info"; ?>" href="<?php echo JRoute::_('index.php?option=com_content&view=articles&filter[category_id]='
. (int) $item->id . '&filter[published]=2' . '&filter[level]=' . (int) $item->level);?>">
<?php echo $item->count_archived; ?></a>
</td>
<td class="center btns">
<a class="badge <?php if ($item->count_trashed > 0) echo "badge-inverse"; ?>" href="<?php echo JRoute::_('index.php?option=com_content&view=articles&filter[category_id]='
. (int) $item->id . '&filter[published]=-2' . '&filter[level]=' . (int) $item->level);?>">
Expand Down

0 comments on commit e3ead0a

Please sign in to comment.