diff --git a/modules/mod_menu/helper.php b/modules/mod_menu/helper.php index c8b64e9dd72b0..282a2477e1efb 100644 --- a/modules/mod_menu/helper.php +++ b/modules/mod_menu/helper.php @@ -54,6 +54,13 @@ public static function getList(&$params) { foreach ($items as $i => $item) { + $item->parent = false; + + if (isset($items[$lastitem]) && $items[$lastitem]->id == $item->parent_id) + { + $items[$lastitem]->parent = true; + } + if (($start && $start > $item->level) || ($end && $item->level > $end) || (!$showAll && $item->level > 1 && !in_array($item->parent_id, $path)) @@ -82,8 +89,6 @@ public static function getList(&$params) $items[$lastitem]->level_diff = ($items[$lastitem]->level - $item->level); } - $item->parent = (boolean) $menu->getItems('parent_id', (int) $item->id, true); - $lastitem = $i; $item->active = false; $item->flink = $item->link;