From 736d74d05f70be5b72e44eafe2cc8efae52b0af7 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 16 Mar 2009 04:33:45 +0000 Subject: Clean up the login, maintenance login and required-top-level-login code. We now have two clear and separate login approaches: login/ajax login/html Choose the one that's appropriate. Totally simplified the maintenance page to be separate from the theme and dead simple, and use login/html approach there. Totally simplified the top level login (login_page.html.php) to just be a login page, not the rest of the chrome on the page and use the login/ajax approach there. Don't use access::required in albums and then catch the exception, instead use access::can and check the return code. Improve the text for maintenance mode. --- core/libraries/Theme_View.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'core/libraries/Theme_View.php') diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php index ecae3946..797679fd 100644 --- a/core/libraries/Theme_View.php +++ b/core/libraries/Theme_View.php @@ -36,15 +36,13 @@ class Theme_View_Core extends View { if (user::active()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } - $this->set_global('theme', $this); - $this->set_global('user', user::active()); + $this->set_global("theme", $this); + $this->set_global("user", user::active()); $this->set_global("page_type", $page_type); $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); - if (!empty($maintenance_mode)) { - $album = ORM::factory("item", 1); - message::warning(t("%title is currently unavailable as it is undergoing maintenance", - array("title" => $album->title))); + if ($maintenance_mode) { + message::warning(t("This site is currently in maintenance mode")); } } -- cgit v1.2.3