source: extensions/Autosize/main.inc.php @ 7886

Last change on this file since 7886 was 7886, checked in by cljosse, 13 years ago

[Autosize][beta] bug in main.php ?

File size: 2.9 KB
Line 
1<?php
2/*
3Plugin Name: AutoSize
4Version: 1.0.0
5Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
7Author: cljosse
8Author URI:http://cljosse.free.fr
9*/
10if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
11if (!defined('AUTOSIZE_PATH')) 
12define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
13//=================================================================================
14        $path = AUTOSIZE_PATH; 
15          $plg_data = implode( '', file($path.'main.inc.php') );
16          if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
17          {
18            $plugin['name'] = trim( $val[1] );
19          }
20          if (preg_match("|Version: (.*)|", $plg_data, $val))
21          {
22            $plugin['version'] = trim($val[1]);
23          }
24          if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
25          {
26            $plugin['uri'] = trim($val[1]);
27          }
28          if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
29          {
30            $plugin['description'] = trim($desc);
31          }
32          elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
33          {
34            $plugin['description'] = trim($val[1]);
35          }
36          if ( preg_match("|Author: (.*)|", $plg_data, $val) )
37          {
38            $plugin['author'] = trim($val[1]);
39          }
40          if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
41          {
42            $plugin['author uri'] = trim($val[1]);
43          }
44          if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
45          {
46            list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
47            if (is_numeric($extension)) $plugin['extension'] = $extension;
48          }
49           
50          $plugin = array_map('htmlspecialchars', $plugin);
51//==================================================================     
52                  global $cl_version ;
53                  $cl_version = $plugin;
54include_once(AUTOSIZE_PATH.'autosize.inc.php');
55//==================================================================
56$autosize_controler = new autosize_controler();
57
58add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
59add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 40 );
60
61add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script'),  EVENT_HANDLER_PRIORITY_NEUTRAL+20 ,  2); 
62
63 add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_2'),  EVENT_HANDLER_PRIORITY_NEUTRAL );
64
65 add_event_handler('render_element_content',
66  array(&$autosize_controler, 'cl_autosize_script_3'),  EVENT_HANDLER_PRIORITY_NEUTRAL-1,  2  );
67
68
69 
70?>
Note: See TracBrowser for help on using the repository browser.