summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Theme_View.php
diff options
context:
space:
mode:
authorjhilden <jakobhilden@gmail.com>2009-06-16 22:39:08 -0400
committerjhilden <jakobhilden@gmail.com>2009-06-16 22:39:08 -0400
commita5b314e7e63a67c347bd595f77a114dab5341432 (patch)
tree11a107e8c2ee60da1003057e373eb5af9def54d1 /modules/gallery/libraries/Theme_View.php
parent0054caa9a8b0984ad8fdce002ad2947c5d75cd06 (diff)
parent7ad5e9ee2c6c912932e8c38c992c9b1194c9107a (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/libraries/Theme_View.php')
-rw-r--r--modules/gallery/libraries/Theme_View.php41
1 files changed, 9 insertions, 32 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 484b93b0..31c2faa7 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -109,50 +109,27 @@ class Theme_View_Core extends View {
}
public function album_menu() {
- $menu = Menu::factory("root");
- gallery_menu::album($menu, $this);
-
- foreach (module::active() as $module) {
- if ($module->name == "gallery") {
- continue;
- }
- $class = "{$module->name}_menu";
- if (method_exists($class, "album")) {
- call_user_func_array(array($class, "album"), array(&$menu, $this));
- }
- }
-
- print $menu;
+ $this->_menu("album");
}
public function tag_menu() {
- $menu = Menu::factory("root");
- gallery_menu::tag($menu, $this);
-
- foreach (module::active() as $module) {
- if ($module->name == "gallery") {
- continue;
- }
- $class = "{$module->name}_menu";
- if (method_exists($class, "tag")) {
- call_user_func_array(array($class, "tag"), array(&$menu, $this));
- }
- }
-
- print $menu;
+ $this->_menu("tag");
}
public function photo_menu() {
- $menu = Menu::factory("root");
- gallery_menu::photo($menu, $this);
+ $this->_menu("photo");
+ }
+ private function _menu($type) {
+ $menu = Menu::factory("root");
+ call_user_func_array(array("gallery_menu", $type), array(&$menu, $this));
foreach (module::active() as $module) {
if ($module->name == "gallery") {
continue;
}
$class = "{$module->name}_menu";
- if (method_exists($class, "photo")) {
- call_user_func_array(array($class, "photo"), array(&$menu, $this));
+ if (method_exists($class, $type)) {
+ call_user_func_array(array($class, $type), array(&$menu, $this));
}
}