diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-20 00:50:37 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-20 00:50:37 +0000 |
commit | 99f131d9ae72cf9f954352d7827c1da932ed8c01 (patch) | |
tree | 1de8ad2bddbebf85d67ae9116e6eed6c11c006dd /core/helpers | |
parent | 6564007a9deb7879b67ec67e81ec91841ddd09a4 (diff) |
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.
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/module.php | 10 |
1 files changed, 10 insertions, 0 deletions
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") |