diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-18 07:32:34 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-18 07:32:34 +0000 |
commit | c67234974d578cacfd354b103e1f166e8ea2c426 (patch) | |
tree | 208c16cc8a8d43e60e69b497cfe193d97f885974 /core/libraries | |
parent | aed68bfa9f68bfbc5df09135bec371b98a579671 (diff) |
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!
Diffstat (limited to 'core/libraries')
-rw-r--r-- | core/libraries/Admin_View.php | 17 | ||||
-rw-r--r-- | core/libraries/Theme_View.php | 8 |
2 files changed, 21 insertions, 4 deletions
diff --git a/core/libraries/Admin_View.php b/core/libraries/Admin_View.php index 37ac10d1..4957fdce 100644 --- a/core/libraries/Admin_View.php +++ b/core/libraries/Admin_View.php @@ -42,4 +42,21 @@ class Admin_View_Core extends View { public function display($page_name, $view_class="View") { return new $view_class($page_name); } + + public function admin_menu() { + $menu = new Menu(true); + core_menu::admin($menu, $this); + + foreach (module::installed() as $module) { + if ($module->name == "core") { + continue; + } + $class = "{$module->name}_menu"; + if (method_exists($class, "admin")) { + call_user_func_array(array($class, "admin"), array(&$menu, $this)); + } + } + + print $menu; + } }
\ No newline at end of file diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php index 933fa2c0..02609063 100644 --- a/core/libraries/Theme_View.php +++ b/core/libraries/Theme_View.php @@ -57,17 +57,17 @@ class Theme_View_Core extends View { return new $view_class($page_name); } - public function site_navigation() { + public function site_menu() { $menu = new Menu(true); - core_menu::site_navigation($menu, $this); + core_menu::site($menu, $this); foreach (module::installed() as $module) { if ($module->name == "core") { continue; } $class = "{$module->name}_menu"; - if (method_exists($class, "site_navigation")) { - call_user_func_array(array($class, "site_navigation"), array(&$menu, $this)); + if (method_exists($class, "site")) { + call_user_func_array(array($class, "site"), array(&$menu, $this)); } } |