summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-20 18:19:27 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-20 18:19:27 +0000
commit537bd9445351929ab46102a8d2f19934363925bd (patch)
tree22d6fb2d0533618fae79d1109e02e6f73af6638f
parent6fc195213410374a967dc6bf483fb9a7f63ff3ae (diff)
This change checks that the active theme is available and if its not,
reverts to the default theme.
-rw-r--r--core/libraries/Admin_View.php6
-rw-r--r--core/libraries/Theme_View.php6
2 files changed, 12 insertions, 0 deletions
diff --git a/core/libraries/Admin_View.php b/core/libraries/Admin_View.php
index 9ca585d2..5876b66c 100644
--- a/core/libraries/Admin_View.php
+++ b/core/libraries/Admin_View.php
@@ -29,6 +29,12 @@ class Admin_View_Core extends View {
* @return void
*/
public function __construct($name) {
+ $theme_name = module::get_var("core", "active_site_theme");
+ if (!file_exists("themes/$theme_name")) {
+ module::set_var("core", "active_site_theme", "admin_default");
+ theme::load_themes();
+ Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
+ }
parent::__construct($name);
$this->theme_name = module::get_var("core", "active_admin_theme");
diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php
index 84d86b0b..cce315ff 100644
--- a/core/libraries/Theme_View.php
+++ b/core/libraries/Theme_View.php
@@ -30,6 +30,12 @@ class Theme_View_Core extends View {
* @return void
*/
public function __construct($name, $page_type) {
+ $theme_name = module::get_var("core", "active_site_theme");
+ if (!file_exists("themes/$theme_name")) {
+ module::set_var("core", "active_site_theme", "default");
+ theme::load_themes();
+ Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
+ }
parent::__construct($name);
$this->theme_name = module::get_var("core", "active_site_theme");