summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-06-25 10:17:06 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-06-25 10:17:06 -0700
commite380f19ee29ee1f524aee2d4ebbf4c49f120fb19 (patch)
tree823207ae5c04b0ae20ca3c521155c6827d3b033d
parentd66c496fb1007bbd0b1640496808000c573d95fd (diff)
Fix an issue where a preview of the admin view would not work.
-rw-r--r--modules/gallery/helpers/theme.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php
index a390645f..4730d296 100644
--- a/modules/gallery/helpers/theme.php
+++ b/modules/gallery/helpers/theme.php
@@ -53,6 +53,15 @@ class theme_Core {
if (file_exists(THEMEPATH . self::$site_theme_name . "/admin")) {
array_unshift($modules, THEMEPATH . self::$site_theme_name . "/admin");
}
+ // Admins can override the site theme, temporarily. This lets us preview themes.
+ if (identity::active_user()->admin && $override = $input->get("theme")) {
+ if (file_exists(THEMEPATH . $override)) {
+ self::$admin_theme_name = $override;
+ } else {
+ Kohana_Log::add("error", "Missing override theme: '$override'");
+ }
+ }
+ array_unshift($modules, THEMEPATH . self::$admin_theme_name);
} else {
// Admins can override the site theme, temporarily. This lets us preview themes.
if (identity::active_user()->admin && $override = $input->get("theme")) {