Index: /extensions/Google2Piwigo/admin/import.php
===================================================================
--- /extensions/Google2Piwigo/admin/import.php (revision 24815)
+++ /extensions/Google2Piwigo/admin/import.php (revision 24816)
@@ -170,9 +170,7 @@
if ($duplicates>0)
{
- array_push($page['infos'], l10n_dec(
- 'One picture is not displayed because already existing in the database.',
- '%d pictures are not displayed because already existing in the database.',
- $duplicates
- ));
+ $page['infos'][] = ''
+ .l10n_dec('One picture is not displayed because already existing in the database.', '%d pictures are not displayed because already existing in the database.', $duplicates)
+ .'';
}
@@ -262,9 +260,7 @@
if ($duplicates>0)
{
- array_push($page['infos'], l10n_dec(
- '%d picture is not displayed because already existing in the database.',
- '%d pictures are not displayed because already existing in the database.',
- $duplicates
- ));
+ $page['infos'][] = ''
+ .l10n_dec('One picture is not displayed because already existing in the database.', '%d pictures are not displayed because already existing in the database.', $duplicates)
+ .'';
}
Index: /extensions/Google2Piwigo/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Google2Piwigo/language/en_UK/plugin.lang.php (revision 24815)
+++ /extensions/Google2Piwigo/language/en_UK/plugin.lang.php (revision 24816)
@@ -24,4 +24,5 @@
$lang['Geolocalization'] = 'Geolocalization';
$lang['Logged in as'] = 'Logged in as';
+$lang['Help! I get the error "The site [...] has not been registered."'] = 'Help! I get the error "The site [...] has not been registered."';
?>
Index: /extensions/Google2Piwigo/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Google2Piwigo/language/fr_FR/plugin.lang.php (revision 24815)
+++ /extensions/Google2Piwigo/language/fr_FR/plugin.lang.php (revision 24816)
@@ -24,4 +24,5 @@
$lang['Logged in as'] = 'Indentifié en tant que';
$lang['Geolocalization'] = 'Géolocalisation';
+$lang['Help! I get the error "The site [...] has not been registered."'] = 'A l\'aide! J\'obtiens l\'erreur "The site [...] has not been registered."';
?>
Index: /extensions/Google2Piwigo/main.inc.php
===================================================================
--- /extensions/Google2Piwigo/main.inc.php (revision 24815)
+++ /extensions/Google2Piwigo/main.inc.php (revision 24816)
@@ -4,5 +4,5 @@
Version: auto
Description: Import photos from your Google account (including Picasa Web Albums)
-Plugin URI: http://piwigo.org/ext/extension_view.php?eid=628
+Plugin URI: auto
Author: Mistic
Author URI: http://www.strangeplanet.fr
@@ -17,14 +17,53 @@
define('PICASA_WA_CACHE', PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/');
+if (defined('IN_ADMIN'))
+{
+ add_event_handler('get_admin_plugin_menu_links', 'picasa_wa_admin_menu');
+ add_event_handler('get_batch_manager_prefilters', 'picasa_wa_add_batch_manager_prefilters');
+ add_event_handler('perform_batch_manager_prefilters', 'picasa_wa_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+ add_event_handler('loc_begin_admin_page', 'picasa_wa_prefilter_from_url');
-add_event_handler('get_admin_plugin_menu_links', 'picasa_wa_admin_menu');
+ function picasa_wa_admin_menu($menu)
+ {
+ array_push($menu, array(
+ 'NAME' => 'Google2Piwigo',
+ 'URL' => PICASA_WA_ADMIN,
+ ));
+ return $menu;
+ }
-function picasa_wa_admin_menu($menu)
-{
- array_push($menu, array(
- 'NAME' => 'Google2Piwigo',
- 'URL' => PICASA_WA_ADMIN,
- ));
- return $menu;
+ function picasa_wa_add_batch_manager_prefilters($prefilters)
+ {
+ array_push($prefilters, array(
+ 'ID' => 'picasa',
+ 'NAME' => l10n('Imported from Google/Picasa'),
+ ));
+ return $prefilters;
+ }
+
+ function picasa_wa_perform_batch_manager_prefilters($filter_sets, $prefilter)
+ {
+ if ($prefilter == 'picasa')
+ {
+ $query = '
+ SELECT id
+ FROM '.IMAGES_TABLE.'
+ WHERE file LIKE "picasa-%"
+ ;';
+ $filter_sets[] = array_from_query($query, 'id');
+ }
+
+ return $filter_sets;
+ }
+
+ function picasa_wa_prefilter_from_url()
+ {
+ global $page;
+ if ($page['page'] == 'batch_manager' && @$_GET['prefilter'] == 'picasa')
+ {
+ $_SESSION['bulk_manager_filter'] = array('prefilter' => 'picasa');
+ unset($_GET['prefilter']);
+ }
+ }
}