diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-17 06:42:31 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-17 06:42:31 -0700 |
| commit | 5b767b6443011031190ce2d7580dca2d6dc33e19 (patch) | |
| tree | 4420be728dc57ea2d356038c2a972ae4e594ba0d /modules/gallery | |
| parent | fbefdd55564d2c14e0a4602784abcc51f0279edf (diff) | |
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
Diffstat (limited to 'modules/gallery')
| -rw-r--r-- | modules/gallery/helpers/gallery_menu.php | 3 | ||||
| -rw-r--r-- | modules/gallery/libraries/Admin_View.php | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index fb0234b1..a25832fe 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -149,6 +149,9 @@ class gallery_menu_Core { ->id("theme_options") ->label(t("Theme Options")) ->url(url::site("admin/theme_options")))) + ->append(Menu::factory("submenu") + ->id("statistics_menu") + ->label(t("Statistics"))) ->append(Menu::factory("link") ->id("maintenance") ->label(t("Maintenance")) 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. */ |
