Skip to content

Commit

Permalink
feature 2904: add a link "empty caddie" in the Batch Manager.
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@29076 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Jul 25, 2014
1 parent b97fcf2 commit cacdce6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
21 changes: 21 additions & 0 deletions admin/batch_manager.php
Expand Up @@ -43,6 +43,27 @@

check_input_parameter('selection', $_POST, true, PATTERN_ID);

// +-----------------------------------------------------------------------+
// | specific actions |
// +-----------------------------------------------------------------------+

if (isset($_GET['action']))
{
if ('empty_caddie' == $_GET['action'])
{
$query = '
DELETE FROM '.CADDIE_TABLE.'
WHERE user_id = '.$user['id'].'
;';
pwg_query($query);

$_SESSION['page_infos'] = array(
l10n('Information data registered in database')
);

redirect(get_root_url().'admin.php?page='.$_GET['page']);
}
}

// +-----------------------------------------------------------------------+
// | initialize current set |
Expand Down
5 changes: 5 additions & 0 deletions admin/themes/default/template/batch_manager_global.tpl
Expand Up @@ -352,6 +352,10 @@ $(document).ready(function() {
.slider("values", 0, getSliderKeyFromValue(min, dimension_values[type]) )
.slider("values", 1, getSliderKeyFromValue(max, dimension_values[type]) );
});

jQuery("select[name=filter_prefilter]").change(function() {
jQuery("#empty_caddie").toggle(jQuery(this).val() == "caddie");
});
});

{/footer_script}
Expand All @@ -376,6 +380,7 @@ $(document).ready(function() {
<option value="{$prefilter.ID}" {if isset($filter.prefilter) && $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option>
{/foreach}
</select>
<a id="empty_caddie" href="admin.php?page=batch_manager&amp;action=empty_caddie" style="{if !isset($filter.prefilter) or $filter.prefilter ne 'caddie'}display:none{/if}">{'Empty caddie'|translate}</a>
</li>

<li id="filter_category" {if !isset($filter.category)}style="display:none"{/if}>
Expand Down
3 changes: 2 additions & 1 deletion language/en_GB/admin.lang.php
Expand Up @@ -159,4 +159,5 @@
$lang['Help Me'] = 'Help me';
$lang['An error occured during extraction (%s).'] = 'An error occurred during the files (%s) extraction.';
$lang['An error has occured during upgrade.'] = 'An error has occurred during upgrade.';
$lang['An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.'] = 'An error has occurred during extract. Please check file permissions of your Piwigo installation.<br><a href="%s">Click here to show log error</a>.';
$lang['An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.'] = 'An error has occurred during extract. Please check file permissions of your Piwigo installation.<br><a href="%s">Click here to show log error</a>.';
$lang['Empty caddie'] = 'Empty basket';
1 change: 1 addition & 0 deletions language/en_UK/admin.lang.php
Expand Up @@ -973,4 +973,5 @@
$lang['close'] = 'close';
$lang['Open user details'] = 'Open user details';
$lang['Close user details'] = 'Close user details';
$lang['Empty caddie'] = 'Empty caddie';
?>
1 change: 1 addition & 0 deletions language/fr_FR/admin.lang.php
Expand Up @@ -976,4 +976,5 @@
$lang['Activate it now'] = 'Activate it now';
$lang['Allow users to add a link to their website'] = 'Autoriser les utilisateurs à donner un lien vers leur site web';
$lang['Impossible to deactivate the default theme.'] = 'Impossible de désactiver le thème par défaut.';
$lang['Empty caddie'] = 'Vider le panier';
?>

0 comments on commit cacdce6

Please sign in to comment.