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