aboutsummaryrefslogtreecommitdiffstats
path: root/admin/batch_manager.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-10-09 20:34:35 +0200
committerplegall <plg@piwigo.org>2015-10-09 20:34:35 +0200
commit11ccdff58523d10ccc970b879c5de01e7ec40ee2 (patch)
tree93bb4b59fd1c70980645422bc24cc2cc1cb46027 /admin/batch_manager.php
parent4bf7792c779ee2312de59366afb38f666d49ce46 (diff)
parent474942e62d283e392262082a0f544c8b30b17c4c (diff)
Merge branch 'feature/357-orphans'
Diffstat (limited to '')
-rw-r--r--admin/batch_manager.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/admin/batch_manager.php b/admin/batch_manager.php
index 257b11bb9..9393b5b40 100644
--- a/admin/batch_manager.php
+++ b/admin/batch_manager.php
@@ -63,6 +63,21 @@ DELETE FROM '.CADDIE_TABLE.'
redirect(get_root_url().'admin.php?page='.$_GET['page']);
}
+
+ if ('delete_orphans' == $_GET['action'])
+ {
+ $deleted_count = delete_elements(get_orphans(), true);
+
+ if ($deleted_count > 0)
+ {
+ $_SESSION['page_infos'][] = l10n_dec(
+ '%d photo was deleted', '%d photos were deleted',
+ $deleted_count
+ );
+
+ redirect(get_root_url().'admin.php?page='.$_GET['page']);
+ }
+ }
}
// +-----------------------------------------------------------------------+
@@ -323,15 +338,7 @@ SELECT id
break;
case 'no_album':
- $query = '
-SELECT
- id
- FROM '.IMAGES_TABLE.'
- LEFT JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
- WHERE category_id is null
-;';
- $filter_sets[] = query2array($query, null, 'id');
-
+ $filter_sets[] = get_orphans();
break;
case 'no_tag':