diff --git a/admin/configuration.php b/admin/configuration.php index 3a2a90640..e03d84fb0 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -46,7 +46,6 @@ else } $main_checkboxes = array( - 'gallery_locked', 'allow_user_registration', 'obligatory_user_mail_address', 'rate', @@ -172,16 +171,6 @@ if (isset($_POST['submit'])) } } - if (empty($_POST['gallery_locked']) and $conf['gallery_locked']) - { - $tpl_var = & $template->get_template_vars('header_msgs'); - $msg_key = array_search(l10n('The gallery is locked for maintenance. Please, come back later.'), $tpl_var); - unset($tpl_var[$msg_key]); - } - elseif (!empty($_POST['gallery_locked']) and !$conf['gallery_locked']) - { - $template->append('header_msgs', l10n('The gallery is locked for maintenance. Please, come back later.')); - } foreach( $main_checkboxes as $checkbox) { $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; diff --git a/admin/maintenance.php b/admin/maintenance.php index 405f45053..c8547a118 100644 --- a/admin/maintenance.php +++ b/admin/maintenance.php @@ -47,6 +47,19 @@ $action = isset($_GET['action']) ? $_GET['action'] : ''; switch ($action) { + case 'lock_gallery' : + { + conf_update_param('gallery_locked', 'true'); + redirect(get_root_url().'admin.php?page=maintenance'); + break; + } + case 'unlock_gallery' : + { + conf_update_param('gallery_locked', 'false'); + $_SESSION['page_infos'] = array(l10n('Gallery unlocked')); + redirect(get_root_url().'admin.php?page=maintenance'); + break; + } case 'categories' : { update_uppercats(); @@ -164,6 +177,23 @@ $template->assign( ) ); +if ($conf['gallery_locked']) +{ + $template->assign( + array( + 'U_MAINT_UNLOCK_GALLERY' => sprintf($url_format, 'unlock_gallery'), + ) + ); +} +else +{ + $template->assign( + array( + 'U_MAINT_LOCK_GALLERY' => sprintf($url_format, 'lock_gallery'), + ) + ); +} + // +-----------------------------------------------------------------------+ // | Define advanced features | // +-----------------------------------------------------------------------+ diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl index 232b00356..ea4e32fab 100644 --- a/admin/themes/default/template/configuration.tpl +++ b/admin/themes/default/template/configuration.tpl @@ -32,13 +32,6 @@