From 76c0c7f3a1246319242e8fff7649c1450da0f98e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 27 Oct 2009 13:46:24 -0700 Subject: Change our menu building blocks to use PHP templates so that themes can override them and define their own menu formats. I worry a little bit that this approach may be too heavy since we're now doing a lot more template includes than we were before. Also, I had to change the Menu API to stop using __toString() because you can't throw exceptions from __toString() which would make it an unhappy experience for developers. --- modules/gallery/libraries/Theme_View.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/gallery/libraries/Theme_View.php') diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 68ec325f..d4d8ee2a 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -81,19 +81,19 @@ class Theme_View_Core extends Gallery_View { public function site_menu() { $menu = Menu::factory("root"); module::event("site_menu", $menu, $this); - return $menu->compact(); + return $menu->compact()->render(); } public function album_menu() { $menu = Menu::factory("root"); module::event("album_menu", $menu, $this); - return $menu->compact(); + return $menu->compact()->render(); } public function tag_menu() { $menu = Menu::factory("root"); module::event("tag_menu", $menu, $this); - return $menu->compact(); + return $menu->compact()->render(); } public function photo_menu() { @@ -107,13 +107,13 @@ class Theme_View_Core extends Gallery_View { } module::event("photo_menu", $menu, $this); - return $menu->compact(); + return $menu->compact()->render(); } public function movie_menu() { $menu = Menu::factory("root"); module::event("movie_menu", $menu, $this); - return $menu->compact(); + return $menu->compact()->render(); } public function context_menu($item, $thumbnail_css_selector) { @@ -124,7 +124,7 @@ class Theme_View_Core extends Gallery_View { ->css_class("g-context-menu"); module::event("context_menu", $menu, $this, $item, $thumbnail_css_selector); - return $menu->compact(); + return $menu->compact()->render(); } public function pager() { -- cgit v1.2.3