summaryrefslogtreecommitdiff
path: root/core/libraries
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-25 02:17:53 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-25 02:17:53 +0000
commitdcf3693b3ebcb75436da7df5d2171891357703aa (patch)
tree9d67c2613072f974d3a6b6c39b82647b9a84773b /core/libraries
parent85bdb606bf56a71b4b02fa353129b6c2cfe2b527 (diff)
Add theme debugging. Activate it in the [info] tab in the
scaffolding, then browse around your Gallery3 to see where you can add visible elements via modules.
Diffstat (limited to 'core/libraries')
-rw-r--r--core/libraries/Theme.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/core/libraries/Theme.php b/core/libraries/Theme.php
index df657ad1..68c48587 100644
--- a/core/libraries/Theme.php
+++ b/core/libraries/Theme.php
@@ -62,7 +62,6 @@ class Theme_Core {
*/
public function __call($function, $args) {
switch ($function) {
- case "admin":
case "head":
case "page_top":
case "page_bottom":
@@ -80,23 +79,26 @@ class Theme_Core {
case "photo_top":
case "photo_blocks":
case "photo_bottom":
- if (empty($this->block_helpers[$function])) {
- foreach (module::get_list() as $module) {
- $helper_class = "{$module->name}_block";
- if (method_exists($helper_class, $function)) {
- $this->block_helpers[$function][] = $helper_class;
- }
- }
- }
+ // @todo: restrict access to this option
+ $debug = Session::instance()->get("debug", false);
$blocks = array();
- if (!empty($this->block_helpers[$function])) {
- foreach ($this->block_helpers[$function] as $helper_class) {
+ foreach (module::get_list() as $module) {
+ $helper_class = "{$module->name}_block";
+ if (method_exists($helper_class, $function)) {
$blocks[] = call_user_func_array(
array($helper_class, $function),
array_merge(array($this), $args));
}
}
+ if ($debug) {
+ if ($function != "head") {
+ array_unshift(
+ $blocks, "<div class=\"gAnnotatedThemeBlock gAnnotatedThemeBlock_$function\">" .
+ "<div class=\"title\">$function</div>");
+ $blocks[] = "</div>";
+ }
+ }
return implode("\n", $blocks);
default: