diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-08-01 21:00:30 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-08-01 21:00:30 -0700 |
commit | c33b24c9faf5d83e4f1bfc6d3778da6c37139b3f (patch) | |
tree | 0284f35a4d3d58c474e562d5e149ca0d1a212244 /modules/gallery/libraries/Theme_View.php | |
parent | 49eb3e32b9b8df20360ee6ceb388f00828063efa (diff) |
Make maintenance mode a variable instead of a config. Then create
links on the Admin > Maintenance page to allow you to turn it on and
off. This should be efficient since we cache all vars and look them
up on every request anyway.
This also allows us to have the Fix task enable maintenance mode while
it's running which greatly reduces the chances that somebody will come
along and hork the database while we're tinkering with MPTT pointers.
Fixes ticket #1259.
Diffstat (limited to 'modules/gallery/libraries/Theme_View.php')
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 6246c6f1..7b90c034 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -46,9 +46,11 @@ class Theme_View_Core extends Gallery_View { $this->set_global("thumb_proportion", $this->thumb_proportion()); } - $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); - if ($maintenance_mode) { - message::warning(t("This site is currently in maintenance mode")); + if (module::get_var("gallery", "maintenance_mode", false)) { + if (identity::active_user()->admin) { + message::warning(t("This site is currently in maintenance mode. Visit the <a href=\"%maintenance_url\">maintenance page</a>", array("maintenance_url" => url::site("admin/maintenance")))); + } else + message::warning(t("This site is currently in maintenance mode.")); } } |