From 9af8027cf30e346b8cf42ade14efee39a8221b0d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 17 Jun 2009 21:42:31 +0800 Subject: 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 Signed-off-by: --- modules/gallery/libraries/Admin_View.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/gallery/libraries/Admin_View.php') diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 1f976871..11a96d75 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -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. */ -- cgit v1.2.3