summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-29 06:08:50 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-06-29 06:08:50 -0700
commit42c82ef7f081630c15a5d354205896764348a76a (patch)
tree81fcd4e1298a3b11d7f0b19e153999d5cacdb98d
parentd90e30c37881d4e715b2c798046830242e382d1c (diff)
Temporary checkin to allow merge with trunk... don't integrate
-rw-r--r--modules/gallery/libraries/Theme_View.php29
-rw-r--r--modules/organize/helpers/organize_theme.php3
-rw-r--r--modules/server_add/helpers/server_add_theme.php3
-rw-r--r--themes/admin_default/views/admin.html.php16
4 files changed, 31 insertions, 20 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 25818821..c5888b4a 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -20,6 +20,7 @@
class Theme_View_Core extends View {
private $theme_name = null;
private $scripts = array();
+ private $css = array();
/**
* Attempts to load a view and pre-load view data.
@@ -172,6 +173,10 @@ class Theme_View_Core extends View {
$this->scripts[$file] = 1;
}
+ public function css($file) {
+ $this->css[$file] = 1;
+ }
+
/**
* Combine a series of Javascript files into a single one and cache it in the database, then
* return a single <script> element to refer to it.
@@ -212,6 +217,21 @@ class Theme_View_Core extends View {
}
/**
+ * Combine a series of Javascript files into a single one and cache it in the database, then
+ * return a single <script> element to refer to it.
+ */
+ private function _combine_css() {
+ $links = array();
+ $key = "";
+ foreach (array_keys($this->css) as $file) {
+ $links[] = "<link media=\"screen, projection\" rel=\"stylesheet\" type=\"text/css\" href=\"" .
+ url::file($file) . "\" />";
+
+ }
+ return implode("\n", $links);
+ }
+
+ /**
* Handle all theme functions that insert module content.
*/
public function __call($function, $args) {
@@ -256,8 +276,14 @@ class Theme_View_Core extends View {
array("gallery_theme", $function),
array_merge(array($this), $args));
}
-
}
+
+ // Give the theme a chance to add its blocks
+ $helper_class = "{$this->theme_name}_theme";
+ $blocks[] = call_user_func_array(
+ array($helper_class, $function),
+ array_merge(array($this), $args));
+
foreach (module::active() as $module) {
if ($module->name == "gallery") {
continue;
@@ -271,6 +297,7 @@ class Theme_View_Core extends View {
}
if ($function == "head" || $function == "admin_head") {
+ array_unshift($blocks, $this->_combine_css());
array_unshift($blocks, $this->_combine_script());
}
diff --git a/modules/organize/helpers/organize_theme.php b/modules/organize/helpers/organize_theme.php
index cddc48b6..02f1f589 100644
--- a/modules/organize/helpers/organize_theme.php
+++ b/modules/organize/helpers/organize_theme.php
@@ -22,7 +22,6 @@ class organize_theme {
// @tdo remove the addition css and organize.js (just here to test)
$theme->script("modules/organize/js/organize_init.js");
$theme->script("modules/organize/js/organize.js");
- return "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
- url::file("modules/organize/css/organize.css") . "\" />";
+ $theme->css("modules/organize/css/organize.css");
}
}
diff --git a/modules/server_add/helpers/server_add_theme.php b/modules/server_add/helpers/server_add_theme.php
index 3df57ee4..02f99690 100644
--- a/modules/server_add/helpers/server_add_theme.php
+++ b/modules/server_add/helpers/server_add_theme.php
@@ -27,8 +27,7 @@ class server_add_theme_Core {
static function admin_head($theme) {
$head = array();
if (strpos(Router::$current_uri, "admin/server_add") !== false) {
- $head[] = "<link media=\"screen, projection\" rel=\"stylesheet\" type=\"text/css\" href=\"" .
- url::file("lib/jquery.autocomplete.css") . "\" />";
+ $theme->css("lib/jquery.autocomplete.css");
$base = url::site("__ARGS__");
$csrf = access::csrf_token();
$head[] = "<script> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php
index dfbafe31..1361ae33 100644
--- a/themes/admin_default/views/admin.html.php
+++ b/themes/admin_default/views/admin.html.php
@@ -6,21 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title><?= t("Admin Dashboard") ?></title>
<link rel="shortcut icon" href="<?= url::file("themes/default/images/favicon.ico") ?>" type="image/x-icon" />
- <link rel="stylesheet" type="text/css" href="<?= url::file("lib/yui/reset-fonts-grids.css") ?>"
- media="screen,projection" />
- <link rel="stylesheet" type="text/css" type="text/css" href="<?= url::file("lib/themeroller/ui.base.css") ?>"
- media="screen,projection" />
- <link rel="stylesheet" type="text/css" href="<?= url::file("lib/superfish/css/superfish.css") ?>"
- media="screen,projection" />
- <link rel="stylesheet" type="text/css" href="<?= url::file("themes/default/css/screen.css") ?>"
- media="screen,projection" />
- <link rel="stylesheet" type="text/css" href="<?= $theme->url("css/screen.css") ?>"
- media="screen,projection" />
- <!--[if IE]>
- <link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
- media="screen,print,projection" />
- <![endif]-->
- <?= $theme->admin_head() ?>
+ <?= $theme->admin_head() ?>
</head>
<body <?= $theme->body_attributes() ?>>