diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2008-12-08 06:14:34 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-08 06:14:34 +0000 |
| commit | b878ed174d9e8628098931156d526b3fc028d905 (patch) | |
| tree | ae355456ce164d46a36d1a01b93f9c46a758d780 /core/libraries/Theme_View.php | |
| parent | 655581f3c996a6404f07486ade64d30cab335e8e (diff) | |
Refactor Menu code to create allow you to create menus using a
chainable factory interface and retrieve them by ids. Streamlined the
HTML creation code a little bit in the process, moved the basic menu
functionality into Theme_View and created the option to have different
menus other than site_navigation().
Diffstat (limited to 'core/libraries/Theme_View.php')
| -rw-r--r-- | core/libraries/Theme_View.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php index 1c388596..1ab57f4c 100644 --- a/core/libraries/Theme_View.php +++ b/core/libraries/Theme_View.php @@ -58,9 +58,20 @@ class Theme_View_Core extends View { } public function site_navigation() { - $menu = menus::get_menu_items($this)->__toString(); - Kohana::log("debug", sprintf("[%s%s] site_navigation: %s", __FILE__, __LINE__, $menu)); - return $menu; + $menu = new Menu(true); + core_menu::site_navigation($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)); + } + } + + print $menu; } public function pager() { |
