From 3d1ea2904d982422ce24c43b25d0d4bca6f29aa3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 18 Jan 2009 05:01:00 +0000 Subject: Rename theme callback helpers from xxx_block to xxx_theme to make room for us to rename the dashboard helper to be a block helper since sidebar blocks are not just in the dashboard. --- core/helpers/core_block.php | 76 ------------------------------------------- core/helpers/core_theme.php | 75 ++++++++++++++++++++++++++++++++++++++++++ core/libraries/Admin_View.php | 2 +- core/libraries/Theme_View.php | 2 +- 4 files changed, 77 insertions(+), 78 deletions(-) delete mode 100644 core/helpers/core_block.php create mode 100644 core/helpers/core_theme.php (limited to 'core') diff --git a/core/helpers/core_block.php b/core/helpers/core_block.php deleted file mode 100644 index 48e158be..00000000 --- a/core/helpers/core_block.php +++ /dev/null @@ -1,76 +0,0 @@ -get("debug")) { - $buf .= ""; - } - if ($theme->page_type == "album" && access::can("edit", $theme->item())) { - $buf .= ""; - $buf .= html::script("core/js/quick.js"); - } - return $buf; - } - - static function album_top($theme, $child) { - if (access::can("edit", $album)) { - $edit_link = url::site("quick/pane/$album->id"); - return "
"; - } - } - - static function thumb_top($theme, $child) { - if ($child->type == "photo" && access::can("edit", $child)) { - $edit_link = url::site("quick/pane/$child->id"); - return "
"; - } - } - - static function thumb_bottom($theme, $child) { - if ($child->type == "photo" && access::can("edit", $child)) { - return "
"; - } - } - - static function admin_head($theme) { - if (Session::instance()->get("debug")) { - return ""; - } - } - - static function page_bottom($theme) { - if (Session::instance()->get("profiler", false)) { - $profiler = new Profiler(); - $profiler->render(); - } - } - - static function admin_page_bottom($theme) { - if (Session::instance()->get("profiler", false)) { - $profiler = new Profiler(); - $profiler->render(); - } - } -} \ No newline at end of file diff --git a/core/helpers/core_theme.php b/core/helpers/core_theme.php new file mode 100644 index 00000000..0ccad457 --- /dev/null +++ b/core/helpers/core_theme.php @@ -0,0 +1,75 @@ +get("debug")) { + $buf .= ""; + } + if ($theme->page_type == "album" && access::can("edit", $theme->item())) { + $buf .= ""; + $buf .= html::script("core/js/quick.js"); + } + return $buf; + } + + static function album_top($theme, $child) { + if (access::can("edit", $album)) { + $edit_link = url::site("quick/pane/$album->id"); + return "
"; + } + } + + static function thumb_top($theme, $child) { + if ($child->type == "photo" && access::can("edit", $child)) { + $edit_link = url::site("quick/pane/$child->id"); + return "
"; + } + } + + static function thumb_bottom($theme, $child) { + if ($child->type == "photo" && access::can("edit", $child)) { + return "
"; + } + } + + static function admin_head($theme) { + if (Session::instance()->get("debug")) { + return ""; + } + } + + static function page_bottom($theme) { + if (Session::instance()->get("profiler", false)) { + $profiler = new Profiler(); + $profiler->render(); + } + } + + static function admin_page_bottom($theme) { + if (Session::instance()->get("profiler", false)) { + $profiler = new Profiler(); + $profiler->render(); + } + } +} \ No newline at end of file diff --git a/core/libraries/Admin_View.php b/core/libraries/Admin_View.php index af2d7fa8..e15c0d68 100644 --- a/core/libraries/Admin_View.php +++ b/core/libraries/Admin_View.php @@ -93,7 +93,7 @@ class Admin_View_Core extends View { case "admin_head": $blocks = array(); foreach (module::installed() as $module) { - $helper_class = "{$module->name}_block"; + $helper_class = "{$module->name}_theme"; if (method_exists($helper_class, $function)) { $blocks[] = call_user_func_array( array($helper_class, $function), diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php index 38e8e056..1f8ca559 100644 --- a/core/libraries/Theme_View.php +++ b/core/libraries/Theme_View.php @@ -165,7 +165,7 @@ class Theme_View_Core extends View { case "photo_bottom": $blocks = array(); foreach (module::installed() as $module) { - $helper_class = "{$module->name}_block"; + $helper_class = "{$module->name}_theme"; if (method_exists($helper_class, $function)) { $blocks[] = call_user_func_array( array($helper_class, $function), -- cgit v1.2.3