diff options
author | plegall <plg@piwigo.org> | 2005-04-16 16:56:32 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2005-04-16 16:56:32 +0000 |
commit | b63d91c59e084223d419b4861627673821d3b15b (patch) | |
tree | add112962d09483b6a7ced06cd74fba4fbb538c0 /category.php | |
parent | 41e52d7a8a4086f92fe318c22ed69ef3e6a4047b (diff) |
- elements batch management : element_set page becomes the frontend to
element_set_global and element_set_unit, infos_images (after a long time
of use) become deprecated : the more powerful element_set is used
instead. Consequently, batch management concerns caddie but also "normal
categories".
- refactoring code in admin.php to include the sub-file (clearer)
- caddie : function fill_caddie replaces the code in category.php and can be
used in admin/element_set.php
- caddie : caddie table is added in delete_elements function
git-svn-id: http://piwigo.org/svn/trunk@764 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | category.php | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/category.php b/category.php index 5484804ee..592ca526b 100644 --- a/category.php +++ b/category.php @@ -78,8 +78,7 @@ initialize_category(); // caddie filling :-) if (isset($_GET['caddie'])) { - include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); - // You can't add in caddie elements that are already in ! +// include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); $query = ' SELECT DISTINCT(id) @@ -87,25 +86,7 @@ SELECT DISTINCT(id) INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id '.$page['where'].' ;'; - $ids = array_from_query($query, 'id'); - - $query = ' -SELECT element_id - FROM '.CADDIE_TABLE.' - WHERE user_id = '.$user['id'].' -;'; - $in_caddie = array_from_query($query, 'element_id'); - - $caddiables = array_diff($ids, $in_caddie); - - $datas = array(); - - foreach ($caddiables as $caddiable) - { - array_push($datas, array('element_id' => $caddiable, - 'user_id' => $user['id'])); - } - mass_inserts(CADDIE_TABLE, array('element_id','user_id'), $datas); + fill_caddie(array_from_query($query, 'id')); } // creation of the array containing the cat ids to expand in the menu |