From e380f19ee29ee1f524aee2d4ebbf4c49f120fb19 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 25 Jun 2010 10:17:06 -0700 Subject: Fix an issue where a preview of the admin view would not work. --- modules/gallery/helpers/theme.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules/gallery/helpers') 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")) { -- cgit v1.2.3 From 8ecf28d3efa258d790d6cb31947407deb7149797 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 25 Jun 2010 10:23:11 -0700 Subject: Better fix for the problem that a preview of an admin theme was not showing up. --- modules/gallery/helpers/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index 4730d296..419d986f 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -57,11 +57,11 @@ class theme_Core { if (identity::active_user()->admin && $override = $input->get("theme")) { if (file_exists(THEMEPATH . $override)) { self::$admin_theme_name = $override; + array_unshift($modules, THEMEPATH . self::$admin_theme_name); } 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")) { -- cgit v1.2.3