From 99f131d9ae72cf9f954352d7827c1da932ed8c01 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 20 Dec 2008 00:50:37 +0000 Subject: Create module::load_themes() to load the correct theme after we do routing and know whether we're going to an /admin page or a regular one. --- core/helpers/module.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/helpers/module.php') diff --git a/core/helpers/module.php b/core/helpers/module.php index 2b9a919d..d08efd83 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -144,6 +144,16 @@ class module_Core { self::event("gallery_ready"); } + public static function load_themes() { + $modules = Kohana::config('core.modules'); + if (Router::$controller == "admin") { + array_unshift($modules, THEMEPATH . 'admin_default'); + } else { + array_unshift($modules, THEMEPATH . 'default'); + } + Kohana::config_set('core.modules', $modules); + } + public function get_var($module_name, $name, $default_value=null) { $module = model_cache::get("module", $module_name, "name"); $var = ORM::factory("var") -- cgit v1.2.3