Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions modules/mod_menu/src/Helper/MenuHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public static function getList(&$params)
{
$app = Factory::getApplication();
$menu = $app->getMenu();
$input = $app->getInput();

// Get active menu item
$base = self::getBase($params);
Expand Down Expand Up @@ -65,22 +64,13 @@ public static function getList(&$params)

if ($items)
{
$inputVars = $app->getInput()->getArray();

foreach ($items as $i => $item)
{
$item->parent = false;
$itemParams = $item->getParams();

$item->current = true;

foreach ($item->query as $key => $value)
{
if ($input->get($key) !== $value)
{
$item->current = false;
break;
}
}

if (isset($items[$lastitem]) && $items[$lastitem]->id == $item->parent_id && $itemParams->get('menu_show', 1) == 1)
{
$items[$lastitem]->parent = true;
Expand All @@ -103,6 +93,17 @@ public static function getList(&$params)
continue;
}

$item->current = true;

foreach ($item->query as $key => $value)
{
if (!isset($inputVars[$key]) || $inputVars[$key] !== $value)
{
$item->current = false;
break;
}
}

$item->deeper = false;
$item->shallower = false;
$item->level_diff = 0;
Expand Down