summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-03-11 16:32:55 -0700
committerBharat Mediratta <bharat@menalto.com>2013-03-11 16:32:55 -0700
commit243e3b66ca7a372a31db6a458b056e0c341b8ef5 (patch)
tree22335e43801f0b160ba25a7c870e489a1e1b2c56 /modules
parentff5f386320b150fe3e33440c0dba4c71bc1830ef (diff)
parentc137740e267bdcb6af58c839d0790399d625f41b (diff)
Merge pull request #206 from shadlaws/fix_2050
#2050 - Update Admin_View to handle events like Theme_View.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/libraries/Admin_View.php34
1 files changed, 31 insertions, 3 deletions
diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php
index 62645d18..ba348d7a 100644
--- a/modules/gallery/libraries/Admin_View.php
+++ b/modules/gallery/libraries/Admin_View.php
@@ -93,7 +93,28 @@ class Admin_View_Core extends Gallery_View {
case "body_attributes":
case "html_attributes":
$blocks = array();
+ if (method_exists("gallery_theme", $function)) {
+ switch (count($args)) {
+ case 0:
+ $blocks[] = gallery_theme::$function($this);
+ break;
+ case 1:
+ $blocks[] = gallery_theme::$function($this, $args[0]);
+ break;
+ case 2:
+ $blocks[] = gallery_theme::$function($this, $args[0], $args[1]);
+ break;
+ default:
+ $blocks[] = call_user_func_array(
+ array("gallery_theme", $function),
+ array_merge(array($this), $args));
+ }
+ }
+
foreach (module::active() as $module) {
+ if ($module->name == "gallery") {
+ continue;
+ }
$helper_class = "{$module->name}_theme";
if (class_exists($helper_class) && method_exists($helper_class, $function)) {
$blocks[] = call_user_func_array(
@@ -102,15 +123,22 @@ class Admin_View_Core extends Gallery_View {
}
}
+ $helper_class = theme::$admin_theme_name . "_theme";
+ if (class_exists($helper_class) && method_exists($helper_class, $function)) {
+ $blocks[] = call_user_func_array(
+ array($helper_class, $function),
+ array_merge(array($this), $args));
+ }
+
if (Session::instance()->get("debug")) {
- if ($function != "admin_head") {
+ if ($function != "admin_head" && $function != "body_attributes") {
array_unshift(
- $blocks, "<div class=\"g-annotated-theme-block g-annotated-theme-block_$function\">" .
+ $blocks,
+ "<div class=\"g-annotated-theme-block g-annotated-theme-block_$function g-clear-fix\">" .
"<div class=\"title\">$function</div>");
$blocks[] = "</div>";
}
}
-
return implode("\n", $blocks);
default: