Changeset 19844 for extensions/Autosize/autosize.inc.php
- Timestamp:
- Jan 5, 2013, 4:14:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r19764 r19844 66 66 } 67 67 if(preg_match("|test|", $DEBUG_autosize, $val)) { 68 $infos_message .= "#65 autosize_calcContent: <br>";69 if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;68 $infos_message .= "#65 autosize_calcContent: <br>"; 69 if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ; 70 70 $infos_message .= "SESSION:" . cl_print_var($_SESSION) ; 71 71 $infos_message .= "COOKIE:" . cl_print_var($_COOKIE) ; … … 80 80 self::Fin_php("#80 autosize_calcContent:" . $DEBUG_autosize ); 81 81 } 82 self::reload("#82"); 83 self::Fin_php("#83 autosize_calcContent:" + $DEBUG_autosize); 84 } 85 86 87 if (!isset($_COOKIE['autosize_reload']) ){ 88 if(preg_match("|test_2|", $DEBUG_autosize, $val)) { 89 $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>"; 90 echo $infos_message; 91 self::Fin_php("#91 autosize_calcContent:" . $DEBUG_autosize); 82 unset($_COOKIE['autosize_reload']); 83 } 84 if (!isset($_COOKIE['autosize_reload']) ){ 85 if(preg_match("|test_2|", $DEBUG_autosize, $val)) { 86 $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>"; 87 self::Fin_php("#87 autosize_calcContent:" . $DEBUG_autosize); 92 88 } 93 self::reload("# 93");94 self::Fin_php("#94autosize_calcContent:" + $DEBUG_autosize);89 self::reload("#89"); 90 // self::Fin_php("#90 autosize_calcContent:" + $DEBUG_autosize); 95 91 96 92 } … … 120 116 * INIT 121 117 *********************/ 122 118 static public function init_3(){ 119 120 } 123 121 static public function init_1($content, $image) 124 122 { … … 128 126 if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content; 129 127 130 $windowWidth=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight'];131 $windowHeight=$_COOKIE['windowHeight']-130 ;128 $asp['min_viewport_width']=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight']; 129 $asp['viewport_height']=$_COOKIE['windowHeight']-130 ; 132 130 133 131 $asp['start_position']= 10; 134 $asp['min_viewport_width']= $windowWidth; 135 $asp['viewport_height']= $windowHeight; 132 136 133 } 137 134 /*********************/ 138 135 static public function init($content,$element_info){ 139 136 global $template,$version,$icon_path,$page,$picture,$conf; … … 914 911 //================= Liste ========================= 915 912 $ok= 0 ; 916 $nofile=0 ; 913 $nofile=0 ; global $max_crop; 917 914 //============================================= 918 915 // Liste mini maxi 919 916 //============================================= 920 917 foreach ($img_all as $img_select){ 918 921 919 $img_type = $img_select->get_type(); 922 920 $img_url = $img_select->get_path(); 923 $imgWH = $img_select->get_size(); 921 $max_crop = 0 ; 922 $imgWH = self::Get_Size($img_select); 924 923 if ($img_type=="square" || $img_type=="thumb" ) continue ; 925 924 if($img_type=="Autosize" || $img_type=="SelMaxi"){ … … 934 933 } 935 934 if(preg_match("|get_minfos|", $DEBUG_autosize, $val)) 936 $infos_message .=$img_url . " -> " . $img_type ."<br >";935 $infos_message .=$img_url . " " . $max_crop ." -> " . $img_type . " " . print_r($imgWH,true). " <br >"; 937 936 938 937 if(file_exists(PHPWG_ROOT_PATH.$img_url)){ } // if file … … 1048 1047 1049 1048 } 1049 //================================================================= 1050 1051 static public function Get_Size($Img_Select){ 1052 global $max_crop; 1053 $imgWH = $Img_Select->get_size(); 1054 $img_type = $Img_Select->get_type(); 1055 $smaller = ImageStdParams::get_by_type($img_type); 1056 $max_crop=0; 1057 if($smaller->sizing->max_crop==1){ 1058 $imgWH =$smaller->sizing->min_size; 1059 $max_crop=1; 1060 } 1061 return $imgWH ; 1062 } 1050 1063 //================================================================== 1051 1064 static public function cl_autosize_nofile($img_all){
Note: See TracChangeset
for help on using the changeset viewer.