mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-04 18:59:08 -04:00
Fix for ticket #366
Move the creation of the setting menu back to gallery_menu::admin, now that there is a mechanism to remove empty menu items
This commit is contained in:
@@ -69,9 +69,23 @@ class Admin_View_Core extends View {
|
||||
}
|
||||
}
|
||||
|
||||
$this->_remove_empty_items($menu);
|
||||
print $menu;
|
||||
}
|
||||
|
||||
private function _remove_empty_items($menu) {
|
||||
foreach ($menu->elements as $target_id => $element) {
|
||||
if ($element->type == "submenu") {
|
||||
if (empty($element->elements)) {
|
||||
$menu->remove($target_id);
|
||||
} else {
|
||||
$this->_remove_empty_items($element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print out any site wide status information.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user