bug 2558 fixed: instead of locking the gallery with a simple checkbox among

configuration options, "lock gallery" becomes a maintenance action, with a
confirmation on popup.


git-svn-id: http://piwigo.org/svn/trunk@13001 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2012-01-31 00:33:01 +00:00
parent 907c8e2104
commit 7c322f6d9c
6 changed files with 45 additions and 23 deletions
+30
View File
@@ -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 |
// +-----------------------------------------------------------------------+