diff --git a/admin/maintenance.php b/admin/maintenance.php
index 4af358a3a..34c820152 100644
--- a/admin/maintenance.php
+++ b/admin/maintenance.php
@@ -49,6 +49,10 @@ $maint_actions = array(
'icon' => 'icon-info-circled-1',
'label' => l10n('Update photos information'),
),
+ 'empty_lounge' => array(
+ 'icon' => 'icon-thumbs-up',
+ 'label' => l10n('Empty lounge'),
+ ),
'delete_orphan_tags' => array(
'icon' => 'icon-tags',
'label' => l10n('Delete orphan tags'),
diff --git a/admin/maintenance_actions.php b/admin/maintenance_actions.php
index ce4c6b842..ea07c5564 100644
--- a/admin/maintenance_actions.php
+++ b/admin/maintenance_actions.php
@@ -159,6 +159,12 @@ DELETE
$page['infos'][] = sprintf('%s : %s', l10n('Reinitialize check integrity'), l10n('action successfully performed.'));
break;
}
+ case 'empty_lounge':
+ {
+ $rows = empty_lounge();
+ $page['infos'][] = sprintf('%d photos were moved from the upload lounge to their albums', count($rows));
+ break;
+ }
case 'search' :
{
$query = '
@@ -362,6 +368,23 @@ else
);
}
+$query = '
+SELECT
+ COUNT(*)
+ FROM '.LOUNGE_TABLE.'
+;';
+list($nb_lounge) = pwg_db_fetch_row(pwg_query($query));
+
+if ($nb_lounge > 0)
+{
+ $template->assign(
+ array(
+ 'U_EMPTY_LOUNGE' => sprintf($url_format, 'empty_lounge'),
+ 'LOUNGE_COUNTER' => $nb_lounge,
+ )
+ );
+}
+
$template->assign('isWebmaster', (is_webmaster()) ? 1 : 0);
// +-----------------------------------------------------------------------+
diff --git a/admin/themes/default/template/maintenance_actions.tpl b/admin/themes/default/template/maintenance_actions.tpl
index 63c070296..64d81002a 100644
--- a/admin/themes/default/template/maintenance_actions.tpl
+++ b/admin/themes/default/template/maintenance_actions.tpl
@@ -132,6 +132,9 @@ $(".delete-size-check").click( function () {
{$maint_actions['images']['label']}
{$maint_actions['database']['label']}
{$maint_actions['c13y']['label']}
+{if (isset($U_EMPTY_LOUNGE))}
+ {$maint_actions['empty_lounge']['label']}{$LOUNGE_COUNTER}
+{/if}