From a594779f9bbeccdf52e7c96bed398078f13ac672 Mon Sep 17 00:00:00 2001 From: soanix Date: Tue, 7 Nov 2023 11:46:29 +0100 Subject: [PATCH] ADD visible option in menu --- src/Cavesman/Classes/Menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cavesman/Classes/Menu.php b/src/Cavesman/Classes/Menu.php index 0d3fcc9..42253ea 100644 --- a/src/Cavesman/Classes/Menu.php +++ b/src/Cavesman/Classes/Menu.php @@ -23,7 +23,7 @@ public static function addItem(array $item): void if (!isset(self::$items[$name]['items'][$menu['name']])) { self::$items[$name]['items'][$menu['name']] = $menu; - if (!Config::get('menu.' . $menu . '.items.' . $menu['name'] . '.visible', true)) { + if (!Config::get('menu.' . $menu . '.items.' . $menu['name'] . '.visible', true) || !($menu['visible'] ?? true)) { continue; } } else { @@ -43,7 +43,7 @@ public static function addItem(array $item): void if (isset($itm['items']) && $itm['items']) { foreach ($itm['items'] as $menu) { if (!isset(self::$items[$name]['items'][$menu['name']])) { - if (!Config::get('menu.' . $name . '.items.' . $menu['name'] . '.visible', true)) { + if (!Config::get('menu.' . $name . '.items.' . $menu['name'] . '.visible', true) || !($menu['visible'] ?? true)) { continue; } self::$items[$name]['items'][$menu['name']] = $menu;