mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-22 01:19:54 -04:00
Respect the "theme" variable if we're an admin. This requires us to
change the order of operations in gallery_event::gallery_ready() so that we load users before themes. Fixes ticket #836.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user