Changeset 22191 for extensions/Autosize/autosize.inc.php
- Timestamp:
- Apr 13, 2013, 4:53:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r22133 r22191 39 39 global $defined_types,$pictureSelType,$pictureMap ,$pictureDeriv ,$liste_type,$SRC_IMG; 40 40 global $autosize_parametres,$user_status; 41 global $infos_message,$error_message;42 41 //============================================================================== 43 global $DEBUG_autosize ;42 global $DEBUG_autosize,$infos_message,$error_message; 44 43 if(preg_match("|event|", $DEBUG_autosize, $val)) $infos_message = "autosize_calcContent, " ; 44 if(!realpath($element_info['path'])) return $content; 45 45 46 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 46 47 if ($ma_page !='thePicturePage') return ; … … 93 94 *********************/ 94 95 static public function init_3(){ 96 global $DEBUG_autosize,$infos_message,$error_message; 97 if(preg_match("|event|", $DEBUG_autosize, $val)) $infos_message .= "init_3, " ; 95 98 96 99 } … … 98 101 { 99 102 global $conf, $template, $page; 103 global $DEBUG_autosize,$infos_message,$error_message; 104 if(!realpath($image['path'])) return $content; 105 if(preg_match("|event|", $DEBUG_autosize, $val)) $infos_message .= "init_1, " ; 100 106 if(!isset($conf['AS_panorama'])) return $content; 101 if( !is_array($conf['AS_panorama']) ){ 102 return $content; 103 } 107 if( !is_array($conf['AS_panorama']) ) return $content; 104 108 $asp = & $conf['AS_panorama']; 105 109 if(!isset($asp['in_mode_360'])) $asp['in_mode_360']=""; 106 110 if(!isset($asp['in_mode_180'])) $asp['in_mode_180']=""; 107 108 111 if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content; 109 110 112 $asp['min_viewport_width']=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight']; 111 113 $asp['viewport_height']=$_COOKIE['windowHeight']-130 ; 112 113 114 $asp['start_position']= 10; 114 115 115 } 116 116 /*********************/ … … 119 119 global $user,$Css,$css_slideshow,$css_display,$liste_type; 120 120 global $has_pamoorama,$pictureSelType,$pictureDeriv,$pictureMap; 121 global $ infos_message,$warnings_message;122 123 global $set_miniature,$imgSizeWH ,$DEBUG_autosize;121 global $warnings_message; 122 123 global $set_miniature,$imgSizeWH; 124 124 global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize; 125 125 //======================================================= 126 global $has_pamoorama, $DEBUG_autosize ; 127 128 if(preg_match("|event|", $DEBUG_autosize, $val)) { 129 $infos_message .= "init, "; 130 } ; 126 global $has_pamoorama ; 127 global $DEBUG_autosize,$infos_message,$error_message; 128 if(!realpath($element_info['path'])) return $content; 129 if(preg_match("|event|", $DEBUG_autosize, $val)) $infos_message .= "init, " ; 131 130 132 131 $has_pamoorama = isset($template->files['pamooramics_content'])?"true":"false"; … … 194 193 if(preg_match("|test|", $DEBUG_autosize, $val)) { 195 194 $infos_message .= "#208 <br>Init:SESSION:" . cl_print_var($_SESSION) ; 196 195 197 196 if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ; 198 197 $infos_message .= "Init: COOKIE:" . cl_print_var($_COOKIE) ; … … 210 209 if(preg_match("|c1|", $DEBUG_autosize, $val)) { 211 210 echo "<!-- " . $theImageWidth . "x" . $theImageHeight . " " .cl_print_var($content) ." -->"; 212 self::Fin_php("#21 2: " . $DEBUG_autosize);211 self::Fin_php("#211: " . $DEBUG_autosize); 213 212 } 214 213 return $content; … … 260 259 *************************/ 261 260 static public function init2($content,$element_info){ 262 263 264 261 global $template,$version,$icon_path,$page,$picture,$conf; 265 262 global $user,$Css,$css_slideshow,$css_display,$liste_type; … … 270 267 global $has_pamoorama,$pictureSelType,$pictureDeriv; 271 268 global $DEBUG_autosize; 272 if(preg_match("|event|", $DEBUG_autosize, $val)) { 273 $infos_message .= "init2, "; 274 } ; 269 if(preg_match("|event|", $DEBUG_autosize, $val)) $infos_message .= "init2, "; 270 if(!realpath($element_info['path'])) return $content; 275 271 global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize; 276 272 //-- si Autosize correction redim --------------- … … 307 303 echo "left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" .$theImageHeight."px;"; 308 304 echo "<div style='position:absolute;left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" . $theImageHeight."px;background-color:green;'>"; 309 self::Fin_php("#30 9: " . $content + $DEBUG_autosize);305 self::Fin_php("#305 : " . $content + $DEBUG_autosize); 310 306 311 307 } //INIT2 … … 320 316 global $conf; 321 317 $set_miniature = "<!DOCTYPE html><html><head> 322 <meta http-equiv='content-type' content='text/html; charset=UTF-8'/> 323 <script type='text/javascript' src='themes/default/js/jquery.min.js'></script> 324 <script type='text/javascript' src='plugins/Autosize/js/autosizeDetect.js'></script> 325 <script type='text/javascript' src='plugins/Autosize/js/autosize.cookie.js'></script> 326 <script type='text/javascript' src='themes/default/js/plugins/jquery.ajaxmanager.js'></script>"; $set_miniature .= "<script type='text/javascript' src='plugins/Autosize/js/autosize_ajax.js' id='autosize_ajax' > </script >"; 318 <meta http-equiv='content-type' content='text/html; charset=UTF-8'/> 319 <script type='text/javascript' src='themes/default/js/jquery.min.js'></script> 320 <script type='text/javascript' src='plugins/Autosize/js/autosizeDetect.js'></script> 321 <script type='text/javascript' src='plugins/Autosize/js/autosize.cookie.js'></script> 322 <script type='text/javascript' src='themes/default/js/plugins/jquery.ajaxmanager.js'></script>"; 323 $set_miniature .= "<script type='text/javascript' src='plugins/Autosize/js/autosize_ajax.js' id='autosize_ajax' > </script >"; 327 324 $set_var = "<script type='text/javascript'>\n var COOKIE_PATH = '".cookie_path()."';\n"; 328 325 if(preg_match("|noreload|", $DEBUG_autosize, $val)) { … … 370 367 echo "INIT <pre>"; 371 368 print_r($_COOKIE); 372 self::Fin_php("#3 72: No COOKIE['picture_deriv'] ".$DEBUG_autosize);369 self::Fin_php("#369: No COOKIE['picture_deriv'] ".$DEBUG_autosize); 373 370 } 374 371 … … 380 377 echo "GET:" . cl_print_var($_GET) ; 381 378 echo "POST:" . cl_print_var($_POST) ; 382 self::Fin_php("#3 82: ".$DEBUG_autosize);379 self::Fin_php("#379: ".$DEBUG_autosize); 383 380 } 384 381 … … 391 388 echo $autoscript; 392 389 if (!isset($_COOKIE['autosize_reload']) ){ 393 self::Fin_php("#393: Initialisation ".$DEBUG_autosize); 394 } 395 // 396 390 self::Fin_php("#390: Initialisation ".$DEBUG_autosize); 391 } 397 392 } 398 393 … … 452 447 ); 453 448 if( preg_match("|c2|", $DEBUG_autosize, $val) ){ 454 self::Fin_php( "4 54: " . $DEBUG_autosize);449 self::Fin_php( "449: " . $DEBUG_autosize); 455 450 return $content ; 456 451 … … 517 512 if ($ma_page !='thePicturePage') return ; 518 513 519 514 520 515 $template->func_combine_script(array('id'=>'my_script_2', 521 516 'path'=> AUTOSIZE_PATH.'js/JScript.js', … … 540 535 $template->append('footer_elements',$autoscript); 541 536 542 537 543 538 return ; 544 539 }// function cl_autosize_script_3 … … 578 573 if(count($set_miniatures)> 1 ) 579 574 $infos_message .= "PictureDeriv:" . $pictureDeriv. ' miniature:' . cl_print_var( $set_miniature); 580 575 581 576 }else { 582 577 … … 664 659 $template->parse('mes_script'); 665 660 } 666 661 667 662 668 663 if(preg_match("|vue_cookies|", $DEBUG_autosize, $val)) { … … 679 674 $infos_message .= "<br />SelType:" . $pictureSelType."; pictureDeriv:".$pictureDeriv ."; pictureMap:".$pictureMap; 680 675 681 self::Fin_php("#6 81: ".$DEBUG_autosize);676 self::Fin_php("#676: ".$DEBUG_autosize); 682 677 } 683 678 cl_aff_infos_plus(); … … 847 842 } 848 843 849 844 850 845 return $css; 851 846 } … … 872 867 $i++; 873 868 } 874 869 875 870 } 876 871 ; … … 920 915 if(file_exists(PHPWG_ROOT_PATH.$img_url)){ 921 916 } // if file 922 917 923 918 if ($theImage_def==0){ 924 919 // Avant Autosize ou Original; … … 976 971 else 977 972 $maxi_image = $img_select; 978 973 979 974 $maxi_image->url = $maxi_image->get_path(); 980 975 … … 986 981 $mini_image->url = $mini_image->get_path(); 987 982 } 988 983 989 984 } // for 990 985 //================================================ … … 993 988 $imgSizeWH = $img_select->src_image->get_size(); 994 989 $liste_type["Original"]="Original".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 995 990 996 991 997 992 $retour=(object)'' ; … … 1063 1058 if(!file_exists(PHPWG_ROOT_PATH.$img_url)){ 1064 1059 $img_type = $img_select->get_type(); 1065 1060 1066 1061 $file_id=explode("?",$img_url); 1067 1062 if(count($file_id) ==1){ … … 1076 1071 array_push($nofiles,serialize($file_no)) ; 1077 1072 if( $img_type == $pictureDeriv){ 1078 1073 1079 1074 break ; 1080 1075 } … … 1120 1115 ****************************/ 1121 1116 static public function get_cookies(){ 1122 global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap ;1117 global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap,$DEBUG_autosize; 1123 1118 if(!isset($_COOKIE['picture_deriv'])){ 1124 1119 $pictureDeriv= pwg_get_session_var('picture_deriv'); … … 1133 1128 $_COOKIE['picture_deriv']=$pictureDeriv; 1134 1129 $_COOKIE['picture_map']=$pictureMap; 1135 //================================================================1136 global $DEBUG_autosize;1137 if( isset($_GET['cl_debug']) && $_GET['cl_debug'] =='false') {1138 $DEBUG_autosize="";1139 }else{1140 $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ;1141 $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] : $DEBUG_autosize ;1142 $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ;1143 //===============================================================1144 }1145 1130 if(!isset($_COOKIE['picture_deriv'] )){ 1146 1131 if(preg_match("|test_1|", $DEBUG_autosize, $val)) { 1147 1132 $infos_message .= "not COOKIE['picture_deriv'] -> reload(): <br>"; 1148 self::Fin_php("#11 48autosize_calcContent:" . $DEBUG_autosize );1133 self::Fin_php("#1133 autosize_calcContent:" . $DEBUG_autosize ); 1149 1134 } 1150 1135 unset($_COOKIE['autosize_reload']); … … 1153 1138 if(preg_match("|test_2|", $DEBUG_autosize, $val)) { 1154 1139 $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>"; 1155 self::Fin_php("#11 55autosize_calcContent:" . $DEBUG_autosize);1156 } 1157 self::reload("#11 57");1140 self::Fin_php("#1140 autosize_calcContent:" . $DEBUG_autosize); 1141 } 1142 self::reload("#1142"); 1158 1143 } 1159 1144 }
Note: See TracChangeset
for help on using the changeset viewer.