Update themes::load_theme() to work with mod_rewrite's short urls.

Conflicts:

	modules/gallery/helpers/gallery_event.php
This commit is contained in:
Bharat Mediratta
2009-10-24 10:38:48 -07:00
parent 607662d66b
commit b33762a9f8
2 changed files with 12 additions and 8 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ class gallery_event_Core {
* Initialization.
*/
static function gallery_ready() {
theme::load_themes(Input::instance()->server("PATH_INFO"));
user::load_user();
theme::load_themes();
identity::load_user();
locales::set_request_locale();
}
+10 -6
View File
@@ -28,13 +28,17 @@ 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($path) {
$modules = Kohana::config("core.modules");
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"));
static function load_themes() {
$path = Input::instance()->server("PATH_INFO");
if (empty($path)) {
$path = "/" . Input::instance()->get("kohana_uri");
}
$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);
}