From 072ae305f8570df92b44efd2e78915a05327a378 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 8 Feb 2018 13:05:11 +0100 Subject: [PATCH] (cp b6d61a7) fixes #838, tells PHP how many photos were deleted in Batch Manager --- admin/batch_manager_global.php | 10 +++++++++- admin/themes/default/js/batchManagerGlobal.js | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index bc10761ae..51987ec3f 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -56,7 +56,15 @@ check_input_parameter('dissociate', $_POST, false, PATTERN_ID); // +-----------------------------------------------------------------------+ $collection = array(); -if (isset($_POST['setSelected'])) +if (isset($_POST['nb_photos_deleted'])) +{ + check_input_parameter('nb_photos_deleted', $_POST, false, '/^\d+$/'); + + // let's fake a collection (we don't know the image_ids so we use "null", we only + // care about the number of items here) + $collection = array_fill(0, $_POST['nb_photos_deleted'], null); +} +else if (isset($_POST['setSelected'])) { $collection = $page['cat_elements_id']; } diff --git a/admin/themes/default/js/batchManagerGlobal.js b/admin/themes/default/js/batchManagerGlobal.js index febfccb4f..50986a680 100644 --- a/admin/themes/default/js/batchManagerGlobal.js +++ b/admin/themes/default/js/batchManagerGlobal.js @@ -309,6 +309,10 @@ jQuery('#applyAction').click(function(e) { image_ids = Array(); } + + /* tell PHP how many photos were deleted */ + jQuery('form').append(''); + return false; });