Index: extensions/batch_manager_prefilters/index.php
===================================================================
--- extensions/batch_manager_prefilters/index.php	(revision 10379)
+++ extensions/batch_manager_prefilters/index.php	(revision 10379)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/batch_manager_prefilters/language/en_UK/description.txt
===================================================================
--- extensions/batch_manager_prefilters/language/en_UK/description.txt	(revision 10379)
+++ extensions/batch_manager_prefilters/language/en_UK/description.txt	(revision 10379)
@@ -0,0 +1,1 @@
+Add some prefilters in Batch Manager.
Index: extensions/batch_manager_prefilters/language/en_UK/index.php
===================================================================
--- extensions/batch_manager_prefilters/language/en_UK/index.php	(revision 10379)
+++ extensions/batch_manager_prefilters/language/en_UK/index.php	(revision 10379)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/batch_manager_prefilters/language/en_UK/plugin.lang.php
===================================================================
--- extensions/batch_manager_prefilters/language/en_UK/plugin.lang.php	(revision 10379)
+++ extensions/batch_manager_prefilters/language/en_UK/plugin.lang.php	(revision 10379)
@@ -0,0 +1,7 @@
+<?php
+
+$lang['with tags'] = 'with tags';
+$lang['with HD'] = 'with HD';
+$lang['without HD'] = 'without HD';
+
+?>
Index: extensions/batch_manager_prefilters/language/fr_FR/description.txt
===================================================================
--- extensions/batch_manager_prefilters/language/fr_FR/description.txt	(revision 10379)
+++ extensions/batch_manager_prefilters/language/fr_FR/description.txt	(revision 10379)
@@ -0,0 +1,1 @@
+Ajoute des préfiltres dans la gestion par lot.
Index: extensions/batch_manager_prefilters/language/fr_FR/index.php
===================================================================
--- extensions/batch_manager_prefilters/language/fr_FR/index.php	(revision 10379)
+++ extensions/batch_manager_prefilters/language/fr_FR/index.php	(revision 10379)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/batch_manager_prefilters/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/batch_manager_prefilters/language/fr_FR/plugin.lang.php	(revision 10379)
+++ extensions/batch_manager_prefilters/language/fr_FR/plugin.lang.php	(revision 10379)
@@ -0,0 +1,7 @@
+<?php
+
+$lang['with tags'] = 'avec tags';
+$lang['with HD'] = 'avec HD';
+$lang['without HD'] = 'sans HD';
+
+?>
Index: extensions/batch_manager_prefilters/language/index.php
===================================================================
--- extensions/batch_manager_prefilters/language/index.php	(revision 10379)
+++ extensions/batch_manager_prefilters/language/index.php	(revision 10379)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/batch_manager_prefilters/main.inc.php
===================================================================
--- extensions/batch_manager_prefilters/main.inc.php	(revision 10379)
+++ extensions/batch_manager_prefilters/main.inc.php	(revision 10379)
@@ -0,0 +1,52 @@
+<?php
+/*
+Plugin Name: Batch Manager Prefilters
+Version: auto
+Description: Add some prefilters in Batch Manager.
+Plugin URI: auto
+Author: P@t
+Author URI: http://www.gauchon.com
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+add_event_handler('get_batch_manager_prefilters', 'add_bmp');
+add_event_handler('perform_batch_manager_prefilters', 'perform_bmp', 50, 2);
+
+function add_bmp($prefilters)
+{
+  load_language('plugin.lang', dirname(__FILE__).'/');
+
+  array_push($prefilters,
+    array('ID' => 'with tags', 'NAME' => l10n('with tags')),
+    array('ID' => 'with HD', 'NAME' => l10n('with HD')),
+    array('ID' => 'without HD', 'NAME' => l10n('without HD'))
+  );
+
+  return $prefilters;
+}
+
+function perform_bmp($filter_sets, $prefilter)
+{
+  if ('with tags' == $prefilter)
+  {
+    $query = 'SELECT DISTINCT image_id FROM '.IMAGE_TAG_TABLE.';';
+    array_push($filter_sets, array_from_query($query, 'image_id'));
+  }
+
+  if ('with HD' == $prefilter)
+  {
+    $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE has_high IS NOT NULL;';
+    array_push($filter_sets, array_from_query($query, 'id'));
+  }
+
+  if ('without HD' == $prefilter)
+  {
+    $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE has_high IS NULL;';
+    array_push($filter_sets, array_from_query($query, 'id'));
+  }
+
+  return $filter_sets;
+}
+
+?>
