From b677778253cdea89e19befbf04441a741010bfc2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 28 Nov 2009 15:42:11 -0800 Subject: Expose theme::$is_admin --- modules/gallery/helpers/theme.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index efc9b9e6..19737c0e 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -25,6 +25,7 @@ */ class theme_Core { public static $active_theme; + public static $is_admin; /** * Load the active theme. This is called at bootstrap time. We will only ever have one theme @@ -37,14 +38,14 @@ class theme_Core { $path = "/" . $input->get("kohana_uri"); } - $is_admin = $path == "/admin" || !strncmp($path, "/admin/", 7); - $setting_name = $is_admin ? "active_admin_theme" : "active_site_theme"; + self::$is_admin = $path == "/admin" || !strncmp($path, "/admin/", 7); + $setting_name = self::$is_admin ? "active_admin_theme" : "active_site_theme"; if (!(identity::active_user()->admin && $theme_name = $input->get("theme"))) { $theme_name = module::get_var("gallery", $setting_name); if (!file_exists(THEMEPATH . $theme_name)) { Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme."); - $theme_name = $is_admin ? "admin_wind" : "wind"; + $theme_name = self::$is_admin ? "admin_wind" : "wind"; module::set_var("gallery", $setting_name, $theme_name); } } -- cgit v1.2.3