source: extensions/Autosize/admin/admin_autosize.php @ 9473

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

[Autosize][beta] compatibility (admin.tpl) whith piwigo 2.2


File size: 6.4 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!');
25if (!defined('AUTOSIZE_DIR')) define('AUTOSIZE_DIR' , basename(dirname(__FILE__)));
26if (!defined('AUTOSIZE_PATH')) 
27define(
28  'AUTOSIZE_PATH',
29   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
30);
31if (!defined('ROOT_URL')) 
32define(  'ROOT_URL',  get_root_url().'/' );
33if (!defined('AUTOSIZE_PATH_ABS')) 
34define('AUTOSIZE_PATH_ABS', dirname(__FILE__).'/' );
35
36// +-----------------------------------------------------------------------+
37// | Check Access and exit when user status is not ok                      |
38// +-----------------------------------------------------------------------+
39//check_status(ACCESS_ADMINISTRATOR);
40include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
41include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
42
43$my_base_url = get_admin_plugin_menu_link(__FILE__);
44
45
46
47$tabsheet = new tabsheet();
48$tabsheet->add( 'autosize_admin',
49                l10n('admin'),
50                $my_base_url.'&amp;tab=autosize_admin'
51                           );
52 /*     
53$tabsheet->add( 'autosize_help',
54                l10n('help'),
55                $my_base_url.'&amp;tab=autosize_help'
56                           );
57                           
58        */         
59                           
60        if (!isset($_GET['tab']))
61           $page['tab'] = 'autosize_admin';
62else
63       $page['tab'] = $_GET['tab'];     
64           
65                           
66$tabsheet->select($page['tab']);
67$tabsheet->assign();
68
69$page['global'] = array();
70$error = array();
71
72global $user, $conf, $errors ;
73global $args, $autosizes_message,$erreur_message ;
74
75include_once (AUTOSIZE_PATH.'include/constants.php'); 
76
77$aff_nb=true;
78
79 ; 
80include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
81include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
82
83
84$my_base_url = get_admin_plugin_menu_link(__FILE__);
85load_language('lang', AUTOSIZE_PATH ); 
86// *************************************************************************
87// |                          Sélection de l'onglet                        |
88// *************************************************************************
89global $infos_message ; 
90global $erreur_message;
91global $conf;
92global $autosize_parametres;
93global $template,$page,$conf ; 
94    global $picture;
95 
96 $visible=true; 
97 $path = AUTOSIZE_PATH;
98 $autosize_parametres = cl_autosize_Get_Options();
99         
100   if (isset($_POST['submit']))  { 
101          if ($_POST['submit'] == l10n('cl_autosize_save'))  { 
102                 cl_autosize_sauve_options_inf() ;
103                     unset($_POST); 
104                 }
105        }       
106        //=========================================
107        if (isset($_POST['img_start']))  {
108                 unset($_POST);
109                 }
110 include (AUTOSIZE_PATH."include/affiche.php");                 
111//================================================================================
112$base_url = get_root_url().'admin_autosize.php';
113switch ($page['tab'])
114 {
115  case 'autosize_admin':
116    $template->set_filenames(array('plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/admin.tpl')));
117    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
118    break; 
119 
120case 'autosize_help': 
121
122 $message="
123    <script id='dimensions' src='./plugins/Autosize/js/jquery.dimensions.js'></script>
124    <script id='Affiche_script' src='./plugins/Autosize/js/Affiche_script.js'></script>
125    <fieldset id='fieldset'>
126    <div class='autosize'
127         autosize='MargeBasse:30px;MargeHaute:30px;parent:fieldset;ResizePicture:true'>
128        <img src='./plugins/Autosize/images/ECO_050.jpg ' width='100%' />       
129    </div>
130</fieldset>"; 
131    if (isset($_POST['valid']))  {      $message = empty($_POST['texte']) ? $message : stripslashes($_POST['texte']);
132        }       
133    //=========================================================================
134   
135
136     $toolbar = 'Full';         //basic
137                $width = 'auto';
138                $height = 'auto';
139                $areas = array();
140                $areas[]='texte';
141                if (!empty($areas)){
142                                if (function_exists('set_fckeditor_instance'))
143                {  $template->set_prefilter('plugin_admin_content', 'add_remove_button');
144                                 set_fckeditor_instance($areas, $toolbar, $width, $height);
145                    }
146                        }
147
148 $template->set_filenames(array( 'plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/help.tpl' )));
149 $template->assign(
150                                        array(
151   'message' =>  $message  ,
152   ));
153
154
155 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
156 break; 
157  }
158       if (!isset($infos_message)){
159                  $infos_message = "";
160                }                 
161                if  ($infos_message != "")  {
162                   array_push($page['infos'],  $infos_message);
163                   $infos_message="";
164                 }
165                if (!isset($erreur_message)){
166                  $erreur_message = "";
167                }               
168                if  ($erreur_message != "")  {
169       
170                  array_push($page['errors'], $erreur_message);
171                  $erreur_message="";
172       
173                 
174                 }               
175                 
176//================================================================
177 
178
179?>
Note: See TracBrowser for help on using the repository browser.