Skip to content

Commit

Permalink
ADD visible option in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
soanix authored Nov 7, 2023
1 parent dbd258f commit a594779
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cavesman/Classes/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit a594779

Please sign in to comment.