Changeset 7872 for extensions/Autosize/main.inc.php
- Timestamp:
- Nov 25, 2010, 12:48:36 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/main.inc.php
r7867 r7872 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 1.3. 7.44 Version: 1.3.8 5 5 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448 … … 13 13 define( 'AUTOSIZE_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' ); 14 14 include_once(AUTOSIZE_PATH.'autosize.inc.php'); 15 global $cl_version,$cl_plugin ; 16 //=================================================================== 17 $path = AUTOSIZE_PATH; 18 $plg_data = implode( '', file($path.'main.inc.php') ); 19 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) 20 { 21 $plugin['name'] = trim( $val[1] ); 22 } 23 if (preg_match("|Version: (.*)|", $plg_data, $val)) 24 { 25 $plugin['version'] = trim($val[1]); 26 } 27 if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) 28 { 29 $plugin['uri'] = trim($val[1]); 30 } 31 if ($desc = load_language('description.txt', $path.'/', array('return' => true))) 32 { 33 $plugin['description'] = trim($desc); 34 } 35 elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) 36 { 37 $plugin['description'] = trim($val[1]); 38 } 39 if ( preg_match("|Author: (.*)|", $plg_data, $val) ) 40 { 41 $plugin['author'] = trim($val[1]); 42 } 43 if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) 44 { 45 $plugin['author uri'] = trim($val[1]); 46 } 47 if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) 48 { 49 list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); 50 if (is_numeric($extension)) $plugin['extension'] = $extension; 51 } 52 // IMPORTANT SECURITY ! 53 $plugin = array_map('htmlspecialchars', $plugin); 54 $cl_version = $plugin; 55 //============================================================================ 15 56 $autosize_controler = new autosize_controler(); 16 57 17 58 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin') ); 18 59 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 40 ); 60 19 61 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 , 2); 20 62 … … 23 65 add_event_handler('render_element_content', 24 66 array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2 ); 67 25 68 //add_event_handler('loc_end_index',array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL ); 26 69
Note: See TracChangeset
for help on using the changeset viewer.