From 8c32e66c9ccd80f018b19eb03385d5f9303871cf Mon Sep 17 00:00:00 2001 From: Geoffry Van den Eede Date: Tue, 20 Nov 2018 11:58:18 +0100 Subject: [PATCH] Update Helper.php Add functionality to have headers in the menu --- components/Helper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/Helper.php b/components/Helper.php index 1e72b588..a1363623 100644 --- a/components/Helper.php +++ b/components/Helper.php @@ -191,6 +191,7 @@ protected static function filterRecursive($items, $user) $result = []; foreach ($items as $i => $item) { $url = ArrayHelper::getValue($item, 'url', '#'); + $class = ArrayHelper::getValue($item, 'options.class', 'header'); $allow = is_array($url) ? static::checkRoute($url[0], array_slice($url, 1), $user) : true; if (isset($item['items']) && is_array($item['items'])) { @@ -203,6 +204,9 @@ protected static function filterRecursive($items, $user) if ($allow && !($url == '#' && empty($item['items']))) { $result[$i] = $item; } + if ($allow && ($class == 'header')) { + $result[$i] = $item; + } } return $result; }