source: extensions/cl_conflit/admin/cl_conflit_admin.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: 6.6 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
23
24if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
25
26if (!defined('CONFLIT_PATH')) 
27define(
28  'CONFLIT_PATH',
29   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
30);
31// +-----------------------------------------------------------------------+
32// | Check Access and exit when user status is not ok                      |
33// +-----------------------------------------------------------------------+
34//check_status(ACCESS_ADMINISTRATOR);
35include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
36include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
37
38$my_base_url = get_admin_plugin_menu_link(__FILE__);
39
40
41
42$tabsheet = new tabsheet();
43$tabsheet->add( 'cl_conflit_admin',
44                l10n('admin'),
45                $my_base_url.'&amp;tab=cl_conflit_admin'
46                           );
47/*                 
48$tabsheet->add( 'cl_conflit_content',
49                l10n('content'),
50                $my_base_url.'&amp;tab=cl_conflit_content'
51                           );
52*/                         
53                           
54                           
55        if (!isset($_GET['tab']))
56           $page['tab'] = 'cl_conflit_admin';
57else
58       $page['tab'] = $_GET['tab'];     
59           
60                           
61$tabsheet->select($page['tab']);
62$tabsheet->assign();
63
64$page['global'] = array();
65$error = array();
66
67global $user, $conf, $errors ;
68global $args, $cl_conflits_message,$erreur_message ;
69
70include_once (CONFLIT_PATH.'include/constants.php'); 
71
72$aff_nb=true;
73
74 ; 
75include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
76include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
77
78
79$my_base_url = get_admin_plugin_menu_link(__FILE__);
80load_language('lang', CONFLIT_PATH ); 
81// *************************************************************************
82// |                          Sélection de l'onglet                        |
83// *************************************************************************
84        $cl_conflits_message =""; 
85        $erreur_message="";
86        global $conf;
87        global $cl_conflit_parametres;
88        global $template,$page,$conf ; 
89        global $picture;
90 
91        $visible=true; 
92
93        $path = CONFLIT_PATH;
94
95          $plg_data = implode( '', file($path.'main.inc.php') );
96          if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
97          {
98            $plugin['name'] = trim( $val[1] );
99          }
100          if (preg_match("|Version: (.*)|", $plg_data, $val))
101          {
102            $plugin['version'] = trim($val[1]);
103          }
104          if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
105          {
106            $plugin['uri'] = trim($val[1]);
107          }
108          if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
109          {
110            $plugin['description'] = trim($desc);
111          }
112          elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
113          {
114            $plugin['description'] = trim($val[1]);
115          }
116          if ( preg_match("|Author: (.*)|", $plg_data, $val) )
117          {
118            $plugin['author'] = trim($val[1]);
119          }
120          if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
121          {
122            $plugin['author uri'] = trim($val[1]);
123          }
124          if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
125          {
126            list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
127            if (is_numeric($extension)) $plugin['extension'] = $extension;
128          }
129          // IMPORTANT SECURITY !
130          $plugin = array_map('htmlspecialchars', $plugin);
131
132                        $version = $plugin['version'] ;
133                        $cl_conflit_parametres = cl_conflit_Get_Options();
134                if (isset($_POST['submit']))  { 
135                        if ($_POST['submit'] == l10n('cl_conflit_save'))  { 
136                                        cl_conflit_sauve_options_inf() ;
137                                        unset($_POST); 
138                                }
139                }       
140        //=========================================
141        if (isset($_POST['img_start']))  {
142                 unset($_POST);
143                 }
144 include (CONFLIT_PATH."include/affiche.php");           
145//================================================================================
146$base_url = get_root_url().'admin_cl_conflit.php';
147switch ($page['tab'])
148 {
149  case 'cl_conflit_admin':
150
151    $template->set_filenames(array('plugin_admin_content' => realpath(CONFLIT_PATH . 'admin/template/admin.tpl'))); 
152    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
153    break; 
154 
155case 'cl_conflit_content':
156
157 
158 $template->set_filenames(array( 'plugin_admin_content' => realpath(CONFLIT_PATH . 'template/picture.tpl' )));
159 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
160 break; 
161  }
162if (!isset($cl_conflits_message)){
163                  $cl_conflits_message = "";
164                } 
165 
166 
167                 
168                if  ($cl_conflits_message != "")  {
169                   array_push($page['cl_conflits'],  $cl_conflits_message);
170                 $cl_conflits_message="";
171                 }
172                if (!isset($erreur_message)){
173                  $erreur_message = "";
174                }               
175                if  ($erreur_message != "")  {
176       
177                  array_push($page['errors'], $erreur_message);
178                  $erreur_message="";
179       
180                 
181                 }               
182                 
183//================================================================
184 
185
186?>
Note: See TracBrowser for help on using the repository browser.