Ignore:
Timestamp:
Dec 26, 2013, 12:07:19 PM (10 years ago)
Author:
mistic100
Message:

update for Piwigo 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Google2Piwigo/main.inc.php

    r24816 r26198  
    99*/
    1010
    11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    1212
    1313global $conf;
    1414
    15 define('PICASA_WA_PATH',  PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    16 define('PICASA_WA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
     15define('PICASA_WA_ID',    basename(dirname(__FILE__)));
     16define('PICASA_WA_PATH',  PHPWG_PLUGINS_PATH . PICASA_WA_ID . '/');
     17define('PICASA_WA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . PICASA_WA_ID);
    1718define('PICASA_WA_CACHE', PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/');
     19
     20
     21include_once(PICASA_WA_PATH . 'include/ws_functions.inc.php');
     22
     23add_event_handler('ws_add_methods', 'picasa_wa_add_ws_method');
    1824
    1925if (defined('IN_ADMIN'))
    2026{
    2127  add_event_handler('get_admin_plugin_menu_links', 'picasa_wa_admin_menu');
     28
    2229  add_event_handler('get_batch_manager_prefilters', 'picasa_wa_add_batch_manager_prefilters');
    2330  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');
    2531
    2632  function picasa_wa_admin_menu($menu)
    2733  {
    28     array_push($menu, array(
     34    $menu[] = array(
    2935      'NAME' => 'Google2Piwigo',
    3036      'URL' => PICASA_WA_ADMIN,
    31     ));
     37      );
    3238    return $menu;
    3339  }
     
    3541  function picasa_wa_add_batch_manager_prefilters($prefilters)
    3642  {
    37     array_push($prefilters, array(
     43    $prefilters[] = array(
    3844      'ID' => 'picasa',
    3945      'NAME' => l10n('Imported from Google/Picasa'),
    40     ));
     46      );
    4147    return $prefilters;
    4248  }
     
    5157    WHERE file LIKE "picasa-%"
    5258  ;';
    53       $filter_sets[] = array_from_query($query, 'id');
     59      $filter_sets[] = query2array($query, null, 'id');
    5460    }
    5561   
    5662    return $filter_sets;
    5763  }
    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   }
    6864}
    69 
    70 
    71 include_once(PICASA_WA_PATH . 'include/ws_functions.inc.php');
    72 
    73 add_event_handler('ws_add_methods', 'picasa_wa_add_ws_method');
    74 
    75 ?>
Note: See TracChangeset for help on using the changeset viewer.