Skip to content

Commit

Permalink
Use a better approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Narloch committed Dec 28, 2017
1 parent adc07c1 commit f4dce78
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/mod_articles_categories/tmpl/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@

defined('_JEXEC') or die;

$input = JFactory::getApplication()->input;
$option = $input->getCmd('option');
$view = $input->getCmd('view');
$id = $input->getInt('id');

foreach ($list as $item) : ?>
<li <?php if ($_SERVER['REQUEST_URI'] === JRoute::_(ContentHelperRoute::getCategoryRoute($item->id), false)) echo ' class="active"'; ?>> <?php $levelup = $item->level - $startLevel - 1; ?>
<li <?php if ($id == $item->id && $view == 'category' && $option == 'com_content') echo ' class="active"'; ?>> <?php $levelup = $item->level - $startLevel - 1; ?>
<h<?php echo $params->get('item_heading') + $levelup; ?>>
<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id)); ?>">
<?php echo $item->title; ?>
Expand Down

0 comments on commit f4dce78

Please sign in to comment.