1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: cl_conflit |
---|
4 | Version: 1.0.0 |
---|
5 | Description: gere les conflits |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php? |
---|
7 | Author: cljosse |
---|
8 | Author URI:http://cljosse.free.fr |
---|
9 | */ |
---|
10 | /*| Ajoute l' option validation de l'autotaille en fonction du statut */ |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | if (!defined('CONFLIT_PATH')) |
---|
13 | define( 'CONFLIT_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' ); |
---|
14 | |
---|
15 | include_once(CONFLIT_PATH.'conflit.inc.php'); |
---|
16 | global $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 | |
---|
61 | add_event_handler('loc_after_page_header', array(&$conflit_controler, 'cl_conflit_script'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 , 2); |
---|
62 | add_event_handler('loc_end_page_tail',array(&$conflit_controler, 'cl_conflit_script_2'), EVENT_HANDLER_PRIORITY_NEUTRAL ); |
---|
63 | add_event_handler('render_element_content',array(&$conflit_controler, 'cl_conflit_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2 ); |
---|
64 | |
---|
65 | |
---|
66 | ?> |
---|