aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set_global.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2007-05-07 22:00:47 +0000
committerplegall <plg@piwigo.org>2007-05-07 22:00:47 +0000
commit6c147eda5417f3cce58b4d235b21e15ef73c4fd5 (patch)
tree4e4aa7d3bffcc5fc4cb81c956d87f1087f89fd91 /admin/element_set_global.php
parent3ae12221acad3ea0fe764391212177d258ff0af8 (diff)
Bug 538 fixed: when managing elements of a virtual category, dissociating
some elements of the current category now instantly removes the elements of the element list. git-svn-id: http://piwigo.org/svn/trunk@2003 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/element_set_global.php')
-rw-r--r--admin/element_set_global.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index 568a37efb..b3f254b10 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -114,16 +114,21 @@ SELECT id
;';
$dissociables = array_from_query($query, 'id');
- if (!empty($dissociables))
- {
- $query = '
+ if (!empty($dissociables))
+ {
+ $query = '
DELETE
FROM '.IMAGE_CATEGORY_TABLE.'
WHERE category_id = '.$_POST['dissociate'].'
AND image_id IN ('.implode(',', $dissociables).')
';
- pwg_query($query);
- }
+ pwg_query($query);
+
+ $page['cat_elements_id'] = array_diff(
+ $page['cat_elements_id'],
+ $dissociables
+ );
+ }
update_category($_POST['dissociate']);
}