diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-23 17:58:55 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-23 17:58:55 -0700 |
commit | 68411cc903a1fedd5014763f55f3925c5a971b0f (patch) | |
tree | b01e2a0458b8868749a9915a3ce472c90d8a063d /modules/gallery/helpers/theme.php | |
parent | cd5485ee845aed96e5ab2eaeb5f92c093ccf260a (diff) |
Allow themes to override event handlers. In gallery::ready() grab the server
PATH_INFO and pass it to the theme::load_themes method. If it starts with
\"/admin\", then set the theme to the active admin theme, otherwise set it to
the active site theme. Fixes ticket #841: Themes cannot overload event classes."
Diffstat (limited to 'modules/gallery/helpers/theme.php')
-rw-r--r-- | modules/gallery/helpers/theme.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index fb8f7ca7..5588fbce 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -28,14 +28,13 @@ class theme_Core { * Load the active theme. This is called at bootstrap time. We will only ever have one theme * active for any given request. */ - static function load_themes() { + static function load_themes($path) { $modules = Kohana::config("core.modules"); - if (Router::$controller == "admin") { + if (strpos($path, "/admin") === 0) { array_unshift($modules, THEMEPATH . module::get_var("gallery", "active_admin_theme")); } else { array_unshift($modules, THEMEPATH . module::get_var("gallery", "active_site_theme")); } - Kohana::config_set("core.modules", $modules); } |