aboutsummaryrefslogtreecommitdiffstats
path: root/admin/batch_manager.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2011-07-30 04:49:02 +0000
committerrvelices <rv-github@modusoptimus.com>2011-07-30 04:49:02 +0000
commitc17ed8b55fc7886a5cbe4797694b310ed3dc4816 (patch)
tree33b35a49c7507fcceb8d12b035f4ab1ac1e38c3b /admin/batch_manager.php
parentafb91c6ca29625cfe3bd422e42ee1bd85153f844 (diff)
feature 2387: addd a filter by tag in the batch manager
git-svn-id: http://piwigo.org/svn/trunk@11853 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/batch_manager.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/admin/batch_manager.php b/admin/batch_manager.php
index c1d3687d4..34bbefeea 100644
--- a/admin/batch_manager.php
+++ b/admin/batch_manager.php
@@ -68,6 +68,11 @@ if (isset($_POST['submitFilter']))
}
}
+ if (isset($_POST['filter_tags_use']))
+ {
+ $_SESSION['bulk_manager_filter']['tags'] = get_tag_ids($_POST['filter_tags'], false);
+ }
+
if (isset($_POST['filter_level_use']))
{
if (in_array($_POST['filter_level'], $conf['available_permission_levels']))
@@ -290,6 +295,20 @@ SELECT id
);
}
+if (!empty($_SESSION['bulk_manager_filter']['tags']))
+{
+ $query = '
+SELECT image_id
+ FROM '.IMAGE_TAG_TABLE.
+ 'WHERE tag_id IN('.implode(',',$_SESSION['bulk_manager_filter']['tags']).')
+ GROUP BY image_id
+ HAVING COUNT(tag_id)='.count($_SESSION['bulk_manager_filter']['tags']);
+ array_push(
+ $filter_sets,
+ get_image_ids_for_tags($_SESSION['bulk_manager_filter']['tags'])
+ );
+}
+
$current_set = array_shift($filter_sets);
foreach ($filter_sets as $set)
{
@@ -365,9 +384,7 @@ if (in_array($page['tab'], $tab_codes))
// +-----------------------------------------------------------------------+
$query = '
-SELECT
- id AS tag_id,
- name AS tag_name
+SELECT id, name
FROM '.TAGS_TABLE.'
;';
$template->assign('tags', get_taglist($query));