diff options
author | jhilden <jakobhilden@gmail.com> | 2009-11-03 17:41:27 -0500 |
---|---|---|
committer | jhilden <jakobhilden@gmail.com> | 2009-11-03 17:41:27 -0500 |
commit | 9768131d149fa47fe545f33cca968c97aa9c9c32 (patch) | |
tree | 0d9b25e1b45100beee004504ab9124d1a338c321 | |
parent | 9a8e9bc7f5deb5108ccc10f27635d66d1ff2b14f (diff) | |
parent | 96cbfe23a6031fc8fb87aadb37fec2e4e479bc0c (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/theme.php | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 67a6f41f..e3cb6a9b 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -23,8 +23,8 @@ class gallery_event_Core { * Initialization. */ static function gallery_ready() { - theme::load_themes(); identity::load_user(); + theme::load_themes(); locales::set_request_locale(); } diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index 64e919e3..da57a37e 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -30,13 +30,16 @@ class theme_Core { */ static function load_themes() { $path = Input::instance()->server("PATH_INFO"); + $input = Input::instance(); if (empty($path)) { - $path = "/" . Input::instance()->get("kohana_uri"); + $path = "/" . $input->get("kohana_uri"); } - $theme_name = module::get_var( - "gallery", - !strncmp($path, "/admin", 6) ? "active_admin_theme" : "active_site_theme"); + if (!(identity::active_user()->admin && $theme_name = $input->get("theme"))) { + $theme_name = module::get_var( + "gallery", + !strncmp($path, "/admin", 6) ? "active_admin_theme" : "active_site_theme"); + } $modules = Kohana::config("core.modules"); array_unshift($modules, THEMEPATH . $theme_name); Kohana::config_set("core.modules", $modules); |