source: extensions/cl_conflit/main.inc.php @ 7880

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

[cl_conflit] create of cl_conflit

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