Browse files

Expose theme::$is_admin

  • Loading branch information...
1 parent 22149b5 commit b677778253cdea89e19befbf04441a741010bfc2 @bharat bharat committed Nov 28, 2009
Showing with 4 additions and 3 deletions.
  1. +4 −3 modules/gallery/helpers/theme.php
View
7 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 @@ static function load_themes() {
$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);
}
}

0 comments on commit b677778

Please sign in to comment.