summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-26 07:51:29 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-06-26 07:51:29 -0700
commit42a5bd20a550a9edb5ec84625037b9d85889ff63 (patch)
tree8d9ff1df3ab5df408edda3d6d751d0d3a0c15296 /modules/gallery/libraries
parenteee8dbe511a86967cc27d93c26718253b301bec6 (diff)
1) Move the generation of script tags to gallery_theme::head and gallery_theme::admin_head. This allows us to potentially manage the scripts like we do in g2 (single file and compressed)
2) Change Theme_View::_call to always call the gallery_theme::$function first.
Diffstat (limited to 'modules/gallery/libraries')
-rw-r--r--modules/gallery/libraries/Theme_View.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 7b2ca840..5235fabb 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -68,9 +68,9 @@ class Theme_View_Core extends View {
return module::get_var("gallery", "thumb_size", 200) / 200;
}
- public function url($path, $absolute_url=false) {
+ public function url($path, $absolute_url=false, $no_root=false) {
$arg = "themes/{$this->theme_name}/$path";
- return $absolute_url ? url::abs_file($arg) : url::file($arg);
+ return $absolute_url ? url::abs_file($arg) : $no_root ? $arg : url::file($arg);
}
public function item() {
@@ -192,7 +192,28 @@ class Theme_View_Core extends View {
case "thumb_info":
case "thumb_top":
$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 (method_exists($helper_class, $function)) {
$blocks[] = call_user_func_array(