[7375] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | Piwigo - a PHP based picture gallery | |
---|
| 4 | // | Autosize | |
---|
| 5 | // +-----------------------------------------------------------------------+ |
---|
| 6 | // | Copyright(C) 2010 cljosse | |
---|
| 7 | // +-----------------------------------------------------------------------+ |
---|
| 8 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 9 | // | it under the terms of the GNU General Public License as published by | |
---|
| 10 | // | the Free Software Foundation | |
---|
| 11 | // | | |
---|
| 12 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 13 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 14 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 15 | // | General Public License for more details. | |
---|
| 16 | // | | |
---|
| 17 | // | You should have received a copy of the GNU General Public License | |
---|
| 18 | // | along with this program; if not, write to the Free Software | |
---|
| 19 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 20 | // | USA. | |
---|
| 21 | // +-----------------------------------------------------------------------+ |
---|
| 22 | class autosize_controler { |
---|
[8627] | 23 | //============================================================ |
---|
| 24 | /* |
---|
| 25 | * cl_autosize_script_1 |
---|
| 26 | */ |
---|
| 27 | static public function cl_autosize_script_1() |
---|
| 28 | { |
---|
| 29 | global $template,$user,$conf,$picture ,$page, $cl_plugin ; |
---|
[11429] | 30 | |
---|
| 31 | header ('X-UA-Compatible: n=7') ; |
---|
| 32 | header ('X-UA-Compatible: IE=Edge') ; |
---|
| 33 | if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ; |
---|
| 34 | |
---|
[10280] | 35 | if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ; |
---|
| 36 | |
---|
[10347] | 37 | $ma_page=isset($page['body_id'])?$page['body_id']:"" ; |
---|
| 38 | if ($ma_page=='thePiwiShackControllerPage') return ; |
---|
[8911] | 39 | |
---|
[8957] | 40 | |
---|
[10347] | 41 | if (PHPWG_VERSION < 2.2 ) |
---|
| 42 | $file =AUTOSIZE_PATH_ABS.'template/header_2_1.tpl' ; |
---|
| 43 | else |
---|
| 44 | $file =AUTOSIZE_PATH_ABS.'template/header_2_2.tpl' ; |
---|
| 45 | $template->set_filenames(array('autosize_init_header'=> $file )); |
---|
[10845] | 46 | $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) ); |
---|
| 47 | //================================================================================================= |
---|
| 48 | $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; |
---|
| 49 | $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; |
---|
| 50 | $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; |
---|
| 51 | //================================================================================================= |
---|
[10347] | 52 | |
---|
| 53 | $autosize_parametres = cl_autosize_Get_Options() ; |
---|
| 54 | $theme=$user['theme']; |
---|
| 55 | $template->assign( |
---|
| 56 | array( |
---|
| 57 | 'autosize_parametres' => $autosize_parametres , |
---|
| 58 | 'cl_plugins' => $cl_plugin , |
---|
| 59 | 'cl_version' => $cl_plugin['version'] , |
---|
| 60 | 'name' => $cl_plugin['name'] , |
---|
[10913] | 61 | 'pamoorama' => isset($PAMOORAMICS_PATH)?"true":"false", |
---|
[10347] | 62 | 'theme' => $theme , |
---|
[10845] | 63 | 'DEBUG_autosize' => $DEBUG_autosize , |
---|
[10347] | 64 | 'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH) , |
---|
| 65 | 'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS, |
---|
[10561] | 66 | 'Version_pwg' => PHPWG_VERSION |
---|
[10347] | 67 | ) |
---|
| 68 | ); |
---|
[8957] | 69 | $template->concat('cl_conflit_init', $template->parse('autosize_init_header', true)); |
---|
[8627] | 70 | return $template->parse( 'autosize_init', false); |
---|
| 71 | }// function cl_autosize_script_1 |
---|
| 72 | //=========================================================== |
---|
| 73 | /* |
---|
[10845] | 74 | * cl_autosize_script_2(admin) |
---|
[8627] | 75 | */ |
---|
| 76 | static public function cl_autosize_script_2() |
---|
| 77 | { |
---|
[8911] | 78 | global $template,$user,$conf,$picture ,$page, $cl_plugin,$known_script ; |
---|
[11429] | 79 | if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ; |
---|
[10280] | 80 | |
---|
[11429] | 81 | $AUTOSIZE_PATH = dirname(__FILE__).'/'; |
---|
[10845] | 82 | //================================================================================================= |
---|
| 83 | $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; |
---|
| 84 | $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; |
---|
| 85 | $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; |
---|
| 86 | //================================================================================================= |
---|
| 87 | |
---|
| 88 | |
---|
[8627] | 89 | $ma_page=isset($page['body_id'])?$page['body_id']:"" ; |
---|
| 90 | $theme=$user['theme']; |
---|
| 91 | if ($ma_page=='thePiwiShackControllerPage') return ; |
---|
| 92 | |
---|
[11961] | 93 | $img_width=isset($picture['current']['width'])?$picture['current']['width']:480; |
---|
| 94 | $img_height=isset($picture['current']['height'])?$picture['current']['height']:320; |
---|
| 95 | |
---|
| 96 | $img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:480; |
---|
| 97 | $img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:320; |
---|
| 98 | $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_width ; |
---|
| 99 | $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:$img_height ; |
---|
| 100 | $window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ; |
---|
| 101 | $window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width ; |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | $size=array( |
---|
| 105 | 'src_img_h' => $src_img_h, |
---|
| 106 | 'src_img_w' => $src_img_w, |
---|
| 107 | 'window_height' =>$window_height, |
---|
| 108 | 'window_width' => $window_width |
---|
| 109 | ); |
---|
| 110 | |
---|
[8627] | 111 | $template->assign( |
---|
| 112 | array( |
---|
| 113 | 'cl_version' => $cl_plugin['version'] , |
---|
| 114 | 'name' => $cl_plugin['name'] , |
---|
| 115 | 'ma_page' => $ma_page, |
---|
| 116 | |
---|
| 117 | 'theme' => $theme , |
---|
[10845] | 118 | 'DEBUG_autosize' => $DEBUG_autosize , |
---|
[11961] | 119 | 'AUTOSIZE_PATH' => AUTOSIZE_PATH, |
---|
| 120 | 'Size' => $size |
---|
| 121 | |
---|
[8627] | 122 | ) |
---|
| 123 | ); |
---|
| 124 | |
---|
| 125 | $autoscript="<script type='text/javascript'> |
---|
| 126 | /* cl_autosize_script_2 */ |
---|
| 127 | if (typeof (save_framework) == 'function') |
---|
| 128 | save_framework('".$ma_page."'); |
---|
| 129 | </script>"; |
---|
[8957] | 130 | |
---|
[11961] | 131 | |
---|
[8627] | 132 | $template->append('footer_elements',$autoscript); |
---|
| 133 | return ; |
---|
| 134 | }// function cl_autosize_script_2 |
---|
| 135 | |
---|
| 136 | //================================================================ |
---|
[7375] | 137 | /* |
---|
[8627] | 138 | * cl_autosize_admin |
---|
| 139 | */ |
---|
| 140 | static public function cl_autosize_admin($menu) |
---|
| 141 | { |
---|
| 142 | global $lang ; |
---|
| 143 | array_push($menu, array('NAME' => 'Autosize', |
---|
| 144 | 'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php'))); |
---|
| 145 | return $menu; |
---|
| 146 | } //function cl_autosize_admin |
---|
| 147 | |
---|
| 148 | //=============================================================== |
---|
| 149 | /* |
---|
[7375] | 150 | * |
---|
[8627] | 151 | */ |
---|
[7375] | 152 | static public function cl_autosize_affiche() |
---|
[7193] | 153 | { |
---|
[8911] | 154 | global $user, $picture, $template,$page,$known_script; |
---|
[7193] | 155 | global $content, $element_info; |
---|
| 156 | global $infos_message,$erreur_message; |
---|
| 157 | global $conf,$lang ,$user,$userdata; |
---|
[11429] | 158 | if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ; |
---|
[10845] | 159 | load_language('plugin.lang', AUTOSIZE_PATH); |
---|
[11429] | 160 | $AUTOSIZE_PATH = dirname(__FILE__).'/'; |
---|
[8070] | 161 | if (isset( $page['body_id']) && $page['body_id']=='thePicturePage' ) { |
---|
| 162 | if ( isset($picture['current'])){ |
---|
[7193] | 163 | $autosize_parametres = cl_autosize_Get_Options(); |
---|
[8911] | 164 | include (AUTOSIZE_PATH."include/affiche.php"); |
---|
[8957] | 165 | |
---|
| 166 | if (PHPWG_VERSION < 2.2 ) |
---|
| 167 | $file =AUTOSIZE_PATH_ABS.'template/picture_2_1.tpl' ; |
---|
| 168 | else |
---|
| 169 | $file =AUTOSIZE_PATH_ABS.'template/picture_2_2.tpl' ; |
---|
| 170 | |
---|
[8959] | 171 | |
---|
| 172 | |
---|
| 173 | $template->set_filenames(array('autosize_content_header'=> $file )); |
---|
[10913] | 174 | $template->concat('autosize_content', $template->parse('autosize_content_header', true)); |
---|
[8959] | 175 | |
---|
| 176 | $template->set_filenames(array('autosize_init_header'=> $file )); |
---|
| 177 | |
---|
[8057] | 178 | if($autosize_parametres->check_icon_v == 'on'){ |
---|
| 179 | $template->assign('cl_autosize_button', |
---|
| 180 | array( 'cl_autosize_info' => 'cl_autosize_info' , |
---|
[10845] | 181 | 'cl_autosize_info_2' => 'cl_autosize_info_2' , |
---|
| 182 | 'URL' => $_SERVER['REQUEST_URI'] , |
---|
| 183 | 'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png', |
---|
| 184 | 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png' |
---|
[8057] | 185 | ) |
---|
[7536] | 186 | |
---|
[8627] | 187 | ); |
---|
[11429] | 188 | $template->set_filenames(array('cl_bp' => $AUTOSIZE_PATH. 'template/picture.tpl')); |
---|
[8057] | 189 | $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true)); |
---|
[7229] | 190 | } |
---|
[8057] | 191 | $template->set_filenames( |
---|
[11429] | 192 | array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl') |
---|
[7193] | 193 | ); |
---|
[11442] | 194 | $template->concat('autosize_content', $template->parse('autosize_content_header', true)); |
---|
| 195 | if(isset($conf['go_up_down']) && ($conf['go_up_down']==true) ){ |
---|
| 196 | $template->set_filenames(array('mes_script' => realpath(AUTOSIZE_PATH).'/template/mes_scripts.tpl') ); |
---|
| 197 | $template->func_combine_script(array('id'=>'my_script_2', |
---|
| 198 | 'path'=> AUTOSIZE_PATH.'/js/JScript.js', |
---|
| 199 | 'require' => 'jquery'), |
---|
| 200 | $template->smarty); |
---|
| 201 | $template->assign(array( |
---|
| 202 | 'MY_FOOTER_PATH' =>AUTOSIZE_PATH |
---|
| 203 | )); |
---|
| 204 | |
---|
| 205 | $template->parse('mes_script'); |
---|
| 206 | } |
---|
| 207 | |
---|
| 208 | |
---|
| 209 | |
---|
| 210 | return $template->parse( 'autosize_content', false); |
---|
[8070] | 211 | } |
---|
[7375] | 212 | } |
---|
[8070] | 213 | |
---|
[7375] | 214 | } //public function cl_autosize_affiche |
---|
[8627] | 215 | //=============================================================== |
---|
| 216 | /* |
---|
[7375] | 217 | * |
---|
| 218 | */ |
---|
[7193] | 219 | static public function cl_autosize_aff_infos_plus() |
---|
| 220 | { |
---|
| 221 | global $template,$infos_message,$erreur_message, $user ; |
---|
[8627] | 222 | global $conf,$lang ; |
---|
[7669] | 223 | |
---|
[7193] | 224 | //============================================================== |
---|
| 225 | if (isset($erreur_message)) |
---|
| 226 | { |
---|
| 227 | if ($erreur_message <> "") |
---|
| 228 | { |
---|
| 229 | $erreur_message=str_replace("\n",'<br />',$erreur_message) ; |
---|
| 230 | $template->assign('errors',$erreur_message); |
---|
| 231 | $erreur_message=""; |
---|
| 232 | } |
---|
| 233 | } |
---|
| 234 | if (isset($infos_message)) |
---|
| 235 | { |
---|
| 236 | |
---|
| 237 | if ($infos_message <> "") |
---|
| 238 | { |
---|
| 239 | $infos_message=str_replace("\n",'<br />',$infos_message) ; |
---|
| 240 | $template->assign('infos',$infos_message); |
---|
| 241 | $infos_message=""; |
---|
| 242 | } |
---|
| 243 | } |
---|
| 244 | //============================================================= |
---|
| 245 | return; |
---|
| 246 | |
---|
[7375] | 247 | } // function cl_autosize_aff_infos_plus |
---|
[8627] | 248 | //=============================================================== |
---|
| 249 | /* |
---|
| 250 | * |
---|
| 251 | */ |
---|
| 252 | static public function cl_ajuste_data($content){ |
---|
| 253 | global $template,$user,$conf,$picture ; |
---|
[11961] | 254 | global $size; |
---|
[11429] | 255 | $AUTOSIZE_PATH = realpath(AUTOSIZE_PATH .'/'); |
---|
[8627] | 256 | $userdata=$user; |
---|
| 257 | $fields = array( 'maxwidth', 'maxheight' ); |
---|
[8070] | 258 | |
---|
[8627] | 259 | $ThePicture = $template->get_template_vars('current'); |
---|
| 260 | $data = array(); |
---|
| 261 | return $content; |
---|
[7816] | 262 | |
---|
[11961] | 263 | $data['maxwidth'] = $size['src_img_w']; |
---|
| 264 | $data['maxheight'] =$size['src_img_h']; |
---|
[8627] | 265 | $data['user_id'] = $userdata['id']; |
---|
| 266 | foreach ($fields as $field) |
---|
[7943] | 267 | { |
---|
[8627] | 268 | if (isset($_POST[$field])) |
---|
| 269 | { |
---|
| 270 | $data[$field] = $_POST[$field]; |
---|
| 271 | } |
---|
[7943] | 272 | } |
---|
[7193] | 273 | |
---|
[8627] | 274 | if($data['maxwidth'] != "" ) |
---|
| 275 | { |
---|
| 276 | $picture['current']['scaled_width']=$data['maxwidth']; |
---|
| 277 | $picture['current']['scaled_height']=$data['maxheight']; |
---|
| 278 | mass_updates(USER_INFOS_TABLE, |
---|
| 279 | array('primary' => array('user_id'), 'update' => $fields), |
---|
| 280 | array($data)); |
---|
| 281 | } |
---|
[7943] | 282 | |
---|
[8627] | 283 | return $content; |
---|
| 284 | } |
---|
[7375] | 285 | |
---|
[11961] | 286 | |
---|
| 287 | /**************************************** |
---|
| 288 | * |
---|
| 289 | ****************************************/ |
---|
| 290 | function Get_Options(&$parametres,$str_index){ |
---|
| 291 | global $conf ; |
---|
| 292 | $m_options= $conf[$str_index]; |
---|
| 293 | if(isset($m_options)) |
---|
| 294 | if ( preg_match("|s:(.*)|", $m_options, $val) ) |
---|
| 295 | $parametres = unserialize($conf[$str_index]); |
---|
| 296 | else{ |
---|
| 297 | $parametres=explode(",",$_options); |
---|
| 298 | } |
---|
| 299 | //====== par defaut ======================= |
---|
| 300 | $new_val=false; |
---|
| 301 | $def_para=Array(); |
---|
| 302 | |
---|
| 303 | $def_para['query'] = 'Qt' ; |
---|
| 304 | $def_para['type'] = 'Ty' ; |
---|
| 305 | $def_para['webmaster_height'] = '100%' ; |
---|
| 306 | $def_para['webmaster_width'] = '100%' ; |
---|
| 307 | $def_para['admin_height'] = '100%' ; |
---|
| 308 | $def_para['admin_width'] = '100%' ; |
---|
| 309 | $def_para['generic_height'] = '100%' ; |
---|
| 310 | $def_para['generic_width'] = '100%' ; |
---|
| 311 | |
---|
| 312 | $def_para['guest_height'] = '100%' ; |
---|
| 313 | $def_para['guest_width'] = '100%' ; |
---|
| 314 | |
---|
| 315 | $def_para['normal_height'] = '100%' ; |
---|
| 316 | $def_para['normal_width'] = '100%' ; |
---|
| 317 | |
---|
| 318 | |
---|
| 319 | $def_para['mini_height'] = '150' ; |
---|
| 320 | $def_para['mini_width'] = '300' ; |
---|
| 321 | |
---|
| 322 | $def_para['mini_height2'] = '150' ; |
---|
| 323 | $def_para['mini_width2'] = '300' ; |
---|
| 324 | |
---|
| 325 | $def_para['echelle_max'] = '1.0'; |
---|
| 326 | $def_para['marge_basse'] = '0'; |
---|
| 327 | $def_para['fade_in'] = '0'; |
---|
| 328 | //================================================== |
---|
| 329 | $def_para['check_desc_v'] = "off" ; |
---|
| 330 | $def_para['check_icon_v'] = "off" ; |
---|
| 331 | $def_para['check_auto_w'] = "off" ; |
---|
| 332 | $def_para['webmaster_enabled'] = "off" ; |
---|
| 333 | $def_para['admin_enabled'] = "off" ; |
---|
| 334 | $def_para['generic_enabled'] = "off" ; |
---|
| 335 | $def_para['guest_enabled'] = "off" ; |
---|
| 336 | $def_para['normal_enabled'] = "off" ; |
---|
| 337 | //=================================================== |
---|
| 338 | $para=$def_para; |
---|
| 339 | foreach ($para as $key => $value) { |
---|
| 340 | if( isset($parametres->$key) ){ |
---|
| 341 | $value=$parametres->$key; |
---|
| 342 | } |
---|
| 343 | if($def_para[$key] =="on" ||$def_para[$key] =="off" ){ |
---|
| 344 | $val_pg=(isset($_POST[$key]))? ($_POST[$key]=="off"||$_POST[$key]=="on")?$_POST[$key]:"on" : "off" ; |
---|
| 345 | $value =(isset($_POST[$key]))? $val_pg : $value ; |
---|
| 346 | $val_pg=(isset($_GET[$key]))? ($_GET[$key]=="off"||$_GET[$key]=="on")?$_GET[$key]:"on" : "off" ; |
---|
| 347 | $value =(isset($_GET[$key]))? $val_pg : $value ; |
---|
| 348 | }else{ |
---|
| 349 | $value =(isset($_POST[$key]))? $_POST[$key] : $value ; |
---|
| 350 | $value =(isset($_GET[$key]))? $_GET[$key] : $value ; |
---|
| 351 | } |
---|
| 352 | unset( $parametres->$key) ; |
---|
| 353 | $parametres->$key = $value ; |
---|
| 354 | } |
---|
| 355 | return $parametres ; |
---|
| 356 | } |
---|
[7375] | 357 | } // class |
---|
| 358 | |
---|
[11961] | 359 | /************************************* |
---|
[7375] | 360 | * |
---|
[11961] | 361 | *************************************/ |
---|
[7193] | 362 | function cl_autosize_Get_Options() |
---|
| 363 | { |
---|
[7394] | 364 | global $conf,$autosize_parametres; |
---|
| 365 | $autosize_parametres = unserialize($conf['cl_autosize']); |
---|
[11961] | 366 | // $autosize_parametres = autosize_controler::Get_Options($autosize_parametres,'cl_autosize'); |
---|
[7394] | 367 | $autosize_parametres = cl_autosize_Set_Options(); |
---|
| 368 | return $autosize_parametres; |
---|
[7375] | 369 | } |
---|
| 370 | /* |
---|
| 371 | * |
---|
[7193] | 372 | */ |
---|
[11961] | 373 | function cl_autosize_Set_Options() { |
---|
[7193] | 374 | global $autosize_parametres; |
---|
| 375 | //============================================================================= |
---|
[7962] | 376 | $my_para=$autosize_parametres; |
---|
[7193] | 377 | |
---|
[11961] | 378 | |
---|
[7962] | 379 | $my_para->query =(isset($_POST['query'])) ? $_POST['query'] : ((isset($my_para->query )) ? $my_para->query : 'Qt' ) ; |
---|
| 380 | $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type: 'Ty') ; |
---|
[7193] | 381 | |
---|
[7962] | 382 | $my_para->webmaster_height =(isset($_POST['webmaster_height'])) ? $_POST['webmaster_height'] : ((isset($my_para->webmaster_height )) ? $my_para->webmaster_height : '100%' ) ; |
---|
[9225] | 383 | $my_para->webmaster_width=(isset($_POST['webmaster_width']))? $_POST['webmaster_width']: ((isset($my_para->webmaster_width)) ? $my_para->webmaster_width: '100%') ; |
---|
[7193] | 384 | |
---|
[9225] | 385 | $my_para->admin_height =(isset($_POST['admin_height'])) ? $_POST['admin_height'] : ((isset($my_para->admin_height )) ? $my_para->admin_height : '100%' ) ; |
---|
| 386 | $my_para->admin_width=(isset($_POST['admin_width']))? $_POST['admin_width']: ((isset($my_para->admin_width)) ? $my_para->admin_width: '100%') ; |
---|
[7193] | 387 | |
---|
[7962] | 388 | $my_para->generic_height =(isset($_POST['generic_height'])) ? $_POST['generic_height'] : ((isset($my_para->generic_height )) ? $my_para->generic_height : '100%' ) ; |
---|
[9225] | 389 | $my_para->generic_width=(isset($_POST['generic_width']))? $_POST['generic_width']: ((isset($my_para->generic_width)) ? $my_para->generic_width: '100%') ; |
---|
[7193] | 390 | |
---|
[7962] | 391 | $my_para->guest_height =(isset($_POST['guest_height'])) ? $_POST['guest_height'] : ((isset($my_para->guest_height )) ? $my_para->guest_height : '100%' ) ; |
---|
[9225] | 392 | $my_para->guest_width=(isset($_POST['guest_width']))? $_POST['guest_width']: ((isset($my_para->guest_width)) ? $my_para->guest_width: '100%') ; |
---|
[7193] | 393 | |
---|
[7962] | 394 | $my_para->normal_height =(isset($_POST['normal_height'])) ? $_POST['normal_height'] : ((isset($my_para->normal_height )) ? $my_para->normal_height : '100%' ) ; |
---|
[9225] | 395 | $my_para->normal_width=(isset($_POST['normal_width']))? $_POST['normal_width']: ((isset($my_para->normal_width)) ? $my_para->normal_width: '100%') ; |
---|
[7193] | 396 | |
---|
[7725] | 397 | |
---|
[7962] | 398 | $my_para->mini_height =(isset($_POST['mini_height'])) ? $_POST['mini_height'] : ((isset($my_para->mini_height )) ? $my_para->mini_height : '150' ) ; |
---|
| 399 | $my_para->mini_width=(isset($_POST['mini_width']))? $_POST['mini_width']: ((isset($my_para->mini_width)) ? $my_para->mini_width: '300') ; |
---|
| 400 | |
---|
| 401 | $my_para->mini_height2 =(isset($_POST['mini_height2'])) ? $_POST['mini_height2'] : ((isset($my_para->mini_height2 )) ? $my_para->mini_height2 : '150' ) ; |
---|
| 402 | $my_para->mini_width2=(isset($_POST['mini_width2']))? $_POST['mini_width2']: ((isset($my_para->mini_width2)) ? $my_para->mini_width2: '300') ; |
---|
| 403 | |
---|
[9473] | 404 | $my_para->echelle_max=(isset($_POST['echelle_max']))? $_POST['echelle_max'] : ((isset($my_para->echelle_max)) ? $my_para->echelle_max : '1.0'); |
---|
[9225] | 405 | $my_para->marge_basse=(isset($_POST['marge_basse']))? $_POST['marge_basse']: ((isset($my_para->marge_basse)) ? $my_para->marge_basse : '0'); |
---|
[9473] | 406 | $my_para->fade_in=(isset($_POST['fade_in']))? $_POST['fade_in']: ((isset($my_para->fade_in)) ? $my_para->fade_in : '0'); |
---|
[7962] | 407 | |
---|
[7193] | 408 | //=============================================================================== |
---|
| 409 | |
---|
| 410 | if ( isset($_POST['submit'] ) && $_POST['submit'] == l10n('cl_autosize_save') ) { |
---|
[7962] | 411 | $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : "off" ; |
---|
| 412 | $my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : "off" ; |
---|
| 413 | $my_para->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : "off" ; |
---|
[7394] | 414 | |
---|
[7962] | 415 | $my_para->webmaster_enabled = isset($_POST['webmaster_enabled']) ? $_POST['webmaster_enabled'] : "off" ; |
---|
| 416 | $my_para->admin_enabled = isset($_POST['admin_enabled']) ? $_POST['admin_enabled'] : "off" ; |
---|
| 417 | $my_para->generic_enabled = isset($_POST['generic_enabled']) ? $_POST['generic_enabled'] : "off" ; |
---|
| 418 | $my_para->guest_enabled = isset($_POST['guest_enabled']) ? $_POST['guest_enabled'] : "off" ; |
---|
| 419 | $my_para->normal_enabled = isset($_POST['normal_enabled']) ? $_POST['normal_enabled'] : "off" ; |
---|
[7394] | 420 | |
---|
[7193] | 421 | }else{ |
---|
[7962] | 422 | $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : ( ( isset($my_para->check_desc_v) ) ? $my_para->check_desc_v : 'off') ; |
---|
| 423 | $my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : ( ( isset($my_para->check_icon_v) ) ? $my_para->check_icon_v : 'off') ; |
---|
| 424 | $my_para->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : ( ( isset($my_para->check_auto_w) ) ? $my_para->check_auto_w : 'off') ; |
---|
[7394] | 425 | |
---|
| 426 | |
---|
[7962] | 427 | $my_para->webmaster_enabled = isset($_POST['webmaster_enabled']) ? $_POST['webmaster_enabled'] : ( ( isset($my_para->webmaster_enabled) ) ? $my_para->webmaster_enabled : 'on') ; |
---|
| 428 | $my_para->admin_enabled = isset($_POST['admin_enabled ']) ? $_POST['admin_enabled '] : ( ( isset($my_para->admin_enabled ) ) ? $my_para->admin_enabled : 'on') ; |
---|
| 429 | $my_para->generic_enabled = isset($_POST['generic_enabled']) ? $_POST['generic_enabled'] : ( ( isset($my_para->generic_enabled) ) ? $my_para->generic_enabled : 'on') ; |
---|
| 430 | $my_para->guest_enabled = isset($_POST['guest_enabled']) ? $_POST['guest_enabled'] : ( ( isset($my_para->guest_enabled) ) ? $my_para->guest_enabled : 'on') ; |
---|
| 431 | $my_para->normal_enabled = isset($_POST['normal_enabled']) ? $_POST['normal_enabled'] : ( ( isset($my_para->normal_enabled) ) ? $my_para->normal_enabled : 'on') ; |
---|
[7394] | 432 | |
---|
| 433 | |
---|
[7193] | 434 | } |
---|
[7316] | 435 | |
---|
[7962] | 436 | return $my_para; |
---|
[7193] | 437 | } |
---|
[7375] | 438 | /* |
---|
| 439 | * |
---|
[7193] | 440 | */ |
---|
| 441 | function cl_autosize_sauve_options_inf() |
---|
| 442 | { |
---|
| 443 | global $options,$infos_message,$conf,$autosize_parametres ; |
---|
| 444 | $infos_message .=l10n("cl_autosize_save_config")."<br>"; |
---|
| 445 | $autosize_parametres=cl_autosize_Set_Options(); |
---|
| 446 | |
---|
| 447 | if ( isset($autosize_parametres) ) |
---|
| 448 | { |
---|
| 449 | |
---|
| 450 | $query = ' |
---|
| 451 | UPDATE '.CONFIG_TABLE.' |
---|
| 452 | SET value="'.addslashes(serialize($autosize_parametres)).'" |
---|
| 453 | WHERE param = "cl_autosize" |
---|
| 454 | LIMIT 1'; |
---|
| 455 | pwg_query($query); |
---|
| 456 | } |
---|
| 457 | |
---|
| 458 | } |
---|
[7375] | 459 | |
---|
[8729] | 460 | function auto_memo_var($variables) |
---|
| 461 | { |
---|
| 462 | ob_start(); |
---|
| 463 | echo '<pre>'; |
---|
| 464 | print_r($variables); |
---|
| 465 | echo '</pre>'; |
---|
| 466 | $m= ob_get_contents(); |
---|
| 467 | ob_end_clean(); |
---|
| 468 | return $m; |
---|
| 469 | } |
---|
| 470 | |
---|
[7375] | 471 | |
---|
[7193] | 472 | ?> |
---|