Changeset 26199 for extensions/instagram2piwigo/main.inc.php
- Timestamp:
- Dec 26, 2013, 12:48:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/instagram2piwigo/main.inc.php
r24817 r26199 9 9 */ 10 10 11 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');11 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 12 12 13 13 global $conf; 14 14 15 define('INSTAG_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 16 define('INSTAG_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__))); 15 define('INSTAG_ID', basename(dirname(__FILE__))); 16 define('INSTAG_PATH', PHPWG_PLUGINS_PATH . INSTAG_ID . '/'); 17 define('INSTAG_ADMIN', get_root_url() . 'admin.php?page=plugin-' . INSTAG_ID); 17 18 define('INSTAG_FS_CACHE', $conf['data_location'].'instagram_cache/'); 19 define('INSTAG_VERSION', 'auto'); 18 20 21 22 include_once(INSTAG_PATH . 'include/ws_functions.inc.php'); 23 24 25 add_event_handler('init', 'instagram_init'); 26 add_event_handler('ws_add_methods', 'instagram_add_ws_method'); 19 27 20 28 if (defined('IN_ADMIN')) 21 29 { 22 30 add_event_handler('get_admin_plugin_menu_links', 'instagram_admin_menu'); 31 23 32 add_event_handler('get_batch_manager_prefilters', 'instagram_add_batch_manager_prefilters'); 24 33 add_event_handler('perform_batch_manager_prefilters', 'instagram_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 25 add_event_handler('loc_begin_admin_page', 'instagram_prefilter_from_url');26 34 27 35 function instagram_admin_menu($menu) 28 36 { 29 array_push($menu,array(37 $menu[] = array( 30 38 'NAME' => 'Instagram2Piwigo', 31 39 'URL' => INSTAG_ADMIN, 32 ));40 ); 33 41 return $menu; 34 42 } … … 36 44 function instagram_add_batch_manager_prefilters($prefilters) 37 45 { 38 array_push($prefilters,array(46 $prefilters[] = array( 39 47 'ID' => 'instagram', 40 48 'NAME' => l10n('Imported from Instagram'), 41 ));49 ); 42 50 return $prefilters; 43 51 } … … 57 65 return $filter_sets; 58 66 } 59 60 function instagram_prefilter_from_url()61 {62 global $page;63 if ($page['page'] == 'batch_manager' && @$_GET['prefilter'] == 'instagram')64 {65 $_SESSION['bulk_manager_filter'] = array('prefilter' => 'instagram');66 unset($_GET['prefilter']);67 }68 }69 67 } 70 68 71 69 72 include_once(INSTAG_PATH . 'include/ws_functions.inc.php'); 70 function instagram_init() 71 { 72 global $conf; 73 73 74 add_event_handler('ws_add_methods', 'instagram_add_ws_method'); 74 include_once(INSTAG_PATH . 'maintain.inc.php'); 75 $maintain = new instagram2piwigo_maintain(INSTAG_ID); 76 $maintain->autoUpdate(INSTAG_VERSION, 'install'); 75 77 76 ?> 78 $conf['Instagram2Piwigo'] = unserialize($conf['Instagram2Piwigo']); 79 }
Note: See TracChangeset
for help on using the changeset viewer.