summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Theme_View.php
diff options
context:
space:
mode:
authormamouneyya <mamoun.diraneyya@gmail.com>2010-08-31 18:04:21 +0300
committermamouneyya <mamoun.diraneyya@gmail.com>2010-08-31 18:04:21 +0300
commit0b6664e8f9d19df025739bc4a0cf1821563d6b3d (patch)
tree5b1de2331d4a9d0eb8d97bbb74be6d794d6260a1 /modules/gallery/libraries/Theme_View.php
parent0a128bab0a788288c5291491a68bd1c9ab432825 (diff)
parent23d59dec7240dfa4bffe9d88f46a848e76ce0134 (diff)
Merge remote branch 'gallery3/master'
Diffstat (limited to 'modules/gallery/libraries/Theme_View.php')
-rw-r--r--modules/gallery/libraries/Theme_View.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 6246c6f1..7a6bc1da 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -46,9 +46,11 @@ class Theme_View_Core extends Gallery_View {
$this->set_global("thumb_proportion", $this->thumb_proportion());
}
- $maintenance_mode = Kohana::config("core.maintenance_mode", false, false);
- if ($maintenance_mode) {
- message::warning(t("This site is currently in maintenance mode"));
+ if (module::get_var("gallery", "maintenance_mode", 0)) {
+ if (identity::active_user()->admin) {
+ message::warning(t("This site is currently in maintenance mode. Visit the <a href=\"%maintenance_url\">maintenance page</a>", array("maintenance_url" => url::site("admin/maintenance"))));
+ } else
+ message::warning(t("This site is currently in maintenance mode."));
}
}
@@ -234,6 +236,13 @@ class Theme_View_Core extends Gallery_View {
case "thumb_bottom":
case "thumb_info":
case "thumb_top":
+ if ($function == "head") {
+ // Stash any CSS we have already; that came from the theme and we want theme CSS to
+ // override module CSs
+ $save_css = $this->css;
+ $this->css = array();
+ }
+
$blocks = array();
if (method_exists("gallery_theme", $function)) {
switch (count($args)) {
@@ -273,6 +282,8 @@ class Theme_View_Core extends Gallery_View {
}
if ($function == "head") {
+ // Merge the theme CSS/JS at the end
+ $this->css = array_merge($this->css, $save_css);
array_unshift($blocks, $this->combine_files($this->css, "css"));
array_unshift($blocks, $this->combine_files($this->scripts, "javascript"));
}