diff options
author | rvelices <rv-github@modusoptimus.com> | 2010-09-09 20:10:50 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2010-09-09 20:10:50 +0000 |
commit | 7b515a89ccc6188246977a5dfdfa1969ff705546 (patch) | |
tree | 011fb86afb8071c518ee1b61b85bc21b79d40749 /admin/element_set_global.php | |
parent | 855a7dbb7a3f7ae325cde96ccb24f72b807ec225 (diff) |
feature 1845 : be able to delete photos added through ftp synchronization
git-svn-id: http://piwigo.org/svn/trunk@6873 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/element_set_global.php | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php index f2c708022..87efab452 100644 --- a/admin/element_set_global.php +++ b/admin/element_set_global.php @@ -77,33 +77,20 @@ if (isset($_POST['delete'])) } } - // filter selection on photos that have no storage_category_id (ie that - // were added via pLoader) if (count($collection) > 0) { - $query = ' -SELECT - id - FROM '.IMAGES_TABLE.' - WHERE id IN ('.implode(',', $collection).') - AND storage_category_id IS NULL -;'; - $deletables = array_from_query($query, 'id'); - - if (count($deletables) > 0) + $deleted_count = delete_elements($collection, true); + if ($deleted_count > 0) { - $physical_deletion = true; - delete_elements($deletables, $physical_deletion); - array_push( $page['infos'], sprintf( l10n_dec( '%d photo was deleted', '%d photos were deleted', - count($deletables) + $deleted_count ), - count($deletables) + $deleted_count ) ); } @@ -321,9 +308,7 @@ $template->assign('IN_CADDIE', 'caddie' == $_GET['cat'] ? true : false ); // | deletion form | // +-----------------------------------------------------------------------+ -// we can only remove photos that have no storage_category_id, in other -// word, it currently (Butterfly) means that the photo was added with -// pLoader +// we can only remove photos that are not remote if (count($page['cat_elements_id']) > 0) { $query = ' @@ -331,7 +316,7 @@ SELECT COUNT(*) FROM '.IMAGES_TABLE.' WHERE id IN ('.implode(',', $page['cat_elements_id']).') - AND storage_category_id IS NULL + AND path NOT LIKE "http%" ;'; list($counter) = pwg_db_fetch_row(pwg_query($query)); |