Changeset 24816


Ignore:
Timestamp:
10/09/13 15:25:56 (6 years ago)
Author:
mistic100
Message:

add batch manager prefilter

Location:
extensions/Google2Piwigo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Google2Piwigo/admin/import.php

    r20670 r24816  
    170170    if ($duplicates>0) 
    171171    { 
    172       array_push($page['infos'], l10n_dec( 
    173           'One picture is not displayed because already existing in the database.',  
    174           '%d pictures are not displayed because already existing in the database.', 
    175           $duplicates 
    176         )); 
     172      $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;prefilter=picasa">' 
     173          .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) 
     174        .'</a>'; 
    177175    } 
    178176     
     
    262260    if ($duplicates>0) 
    263261    { 
    264       array_push($page['infos'], l10n_dec( 
    265           '%d picture is not displayed because already existing in the database.',  
    266           '%d pictures are not displayed because already existing in the database.',  
    267           $duplicates 
    268         )); 
     262      $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;prefilter=picasa">' 
     263          .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) 
     264        .'</a>'; 
    269265    } 
    270266     
  • extensions/Google2Piwigo/language/en_UK/plugin.lang.php

    r20670 r24816  
    2424$lang['Geolocalization'] = 'Geolocalization'; 
    2525$lang['Logged in as'] = 'Logged in as'; 
     26$lang['Help! I get the error "The site [...] has not been registered."'] = 'Help! I get the error "The site [...] has not been registered."'; 
    2627 
    2728?> 
  • extensions/Google2Piwigo/language/fr_FR/plugin.lang.php

    r20670 r24816  
    2424$lang['Logged in as'] = 'Indentifié en tant que'; 
    2525$lang['Geolocalization'] = 'Géolocalisation'; 
     26$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."'; 
    2627 
    2728?> 
  • extensions/Google2Piwigo/main.inc.php

    r19830 r24816  
    44Version: auto 
    55Description: Import photos from your Google account (including Picasa Web Albums) 
    6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=628 
     6Plugin URI: auto 
    77Author: Mistic 
    88Author URI: http://www.strangeplanet.fr 
     
    1717define('PICASA_WA_CACHE', PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/'); 
    1818 
     19if (defined('IN_ADMIN')) 
     20{ 
     21  add_event_handler('get_admin_plugin_menu_links', 'picasa_wa_admin_menu'); 
     22  add_event_handler('get_batch_manager_prefilters', 'picasa_wa_add_batch_manager_prefilters'); 
     23  add_event_handler('perform_batch_manager_prefilters', 'picasa_wa_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
     24  add_event_handler('loc_begin_admin_page', 'picasa_wa_prefilter_from_url'); 
    1925 
    20 add_event_handler('get_admin_plugin_menu_links', 'picasa_wa_admin_menu'); 
     26  function picasa_wa_admin_menu($menu)  
     27  { 
     28    array_push($menu, array( 
     29      'NAME' => 'Google2Piwigo', 
     30      'URL' => PICASA_WA_ADMIN, 
     31    )); 
     32    return $menu; 
     33  } 
    2134 
    22 function picasa_wa_admin_menu($menu)  
    23 { 
    24   array_push($menu, array( 
    25     'NAME' => 'Google2Piwigo', 
    26     'URL' => PICASA_WA_ADMIN, 
    27   )); 
    28   return $menu; 
     35  function picasa_wa_add_batch_manager_prefilters($prefilters) 
     36  { 
     37    array_push($prefilters, array( 
     38      'ID' => 'picasa', 
     39      'NAME' => l10n('Imported from Google/Picasa'), 
     40    )); 
     41    return $prefilters; 
     42  } 
     43 
     44  function picasa_wa_perform_batch_manager_prefilters($filter_sets, $prefilter) 
     45  { 
     46    if ($prefilter == 'picasa') 
     47    { 
     48      $query = ' 
     49  SELECT id 
     50    FROM '.IMAGES_TABLE.' 
     51    WHERE file LIKE "picasa-%" 
     52  ;'; 
     53      $filter_sets[] = array_from_query($query, 'id'); 
     54    } 
     55     
     56    return $filter_sets; 
     57  } 
     58   
     59  function picasa_wa_prefilter_from_url() 
     60  { 
     61    global $page; 
     62    if ($page['page'] == 'batch_manager' && @$_GET['prefilter'] == 'picasa') 
     63    { 
     64      $_SESSION['bulk_manager_filter'] = array('prefilter' => 'picasa'); 
     65      unset($_GET['prefilter']); 
     66    } 
     67  } 
    2968} 
    3069 
Note: See TracChangeset for help on using the changeset viewer.