From c67234974d578cacfd354b103e1f166e8ea2c426 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 18 Dec 2008 07:32:34 +0000 Subject: Refactor site admin menu into a theme function and build the menus in the various modules. In the process, rename xxx_menu::site_navigation() to just xxx_menu::site(). And add xxx_menu::admin(). The menus are the same as before, but I changed the HTML to be consistent with the way that we do it in the regular site, and this broke the superfish styles. I don't know how to fix this.. help me Chad! --- modules/comment/helpers/comment_menu.php | 28 ++++++++++++++++++++++++++++ modules/tag/helpers/tag_menu.php | 28 ++++++++++++++++++++++++++++ modules/user/helpers/user_menu.php | 18 +++++++++++++++++- modules/watermark/helpers/watermark_menu.php | 2 +- 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 modules/comment/helpers/comment_menu.php create mode 100644 modules/tag/helpers/tag_menu.php (limited to 'modules') diff --git a/modules/comment/helpers/comment_menu.php b/modules/comment/helpers/comment_menu.php new file mode 100644 index 00000000..b98140a6 --- /dev/null +++ b/modules/comment/helpers/comment_menu.php @@ -0,0 +1,28 @@ +get("content_menu") + ->append(Menu::factory("link") + ->id("comments") + ->label(_("Comment Moderation")) + ->url("#")); + } +} diff --git a/modules/tag/helpers/tag_menu.php b/modules/tag/helpers/tag_menu.php new file mode 100644 index 00000000..965e66c4 --- /dev/null +++ b/modules/tag/helpers/tag_menu.php @@ -0,0 +1,28 @@ +get("content_menu") + ->append(Menu::factory("link") + ->id("tags") + ->label(_("Tags")) + ->url("#")); + } +} diff --git a/modules/user/helpers/user_menu.php b/modules/user/helpers/user_menu.php index 886a873a..654a0d89 100644 --- a/modules/user/helpers/user_menu.php +++ b/modules/user/helpers/user_menu.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class user_menu_Core { - public static function site_navigation($menu, $theme) { + public static function site($menu, $theme) { $user = user::active(); if (!$user->guest) { $menu->get("admin_menu")->append( @@ -28,4 +28,20 @@ class user_menu_Core { ->url(url::site("users/form/edit/$user->id"))); } } + + public static function admin($menu, $theme) { + $menu->get("users_groups_menu") + ->append(Menu::factory("link") + ->id("list_users") + ->label(_("List Users")) + ->url(url::site("admin/users"))) + ->append(Menu::factory("link") + ->id("create_user") + ->label(_("Create new user")) + ->url("#")) + ->append(Menu::factory("link") + ->id("edit_user") + ->label(_("Edit user")) + ->url("#")); + } } diff --git a/modules/watermark/helpers/watermark_menu.php b/modules/watermark/helpers/watermark_menu.php index 71927da3..9d85319d 100644 --- a/modules/watermark/helpers/watermark_menu.php +++ b/modules/watermark/helpers/watermark_menu.php @@ -20,7 +20,7 @@ class watermark_menu_Core { // @todo this needs to get on the admin page at some point - public static function site_navigation($menu, $theme) { + public static function site($menu, $theme) { $user = user::active(); if ($user->admin) { $menu->get("admin_menu")->append( -- cgit v1.2.3