Changeset 17503 for extensions/Autosize/include
- Timestamp:
- Aug 9, 2012, 8:35:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/include/affiche.php
r17309 r17503 1 1 <?php 2 $visible=(isset($visible))?$visible:false;3 2 3 $visible=(isset($visible))?$visible:false; 4 4 $cl_version=isset($cl_version)?$cl_version:""; 5 5 $cl_plugin=isset($cl_plugin)?$cl_plugin:""; 6 6 $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 7 (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true') 7 (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true'); 8 //============================================================================== 9 $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "false" ; 10 $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] : $DEBUG_autosize ; 11 $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug'] : $DEBUG_autosize ; 12 //=========================================================================== 13 $cookies="' x '"; 8 14 9 ;10 //==============================================================================11 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;12 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;13 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;14 //===========================================================================15 $cookies="' x '";16 17 $current = $template->get_template_vars('current');18 if (isset($_COOKIE['picture_deriv']))19 {20 if (isset($_COOKIE['theImageWidth']))21 $cookies = '"'.$_COOKIE['theImageWidth']." x ". $_COOKIE['theImageHeight'] .'"';22 23 if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) )24 {25 pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);26 }27 setcookie('picture_deriv', false, 0, cookie_path() );28 }29 $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);30 $defined_types = array_keys(ImageStdParams::get_defined_type_map());31 32 if (isset($current)){33 if (!isset($current['selected_derivative'])){34 $model= $defined_types[count($defined_types)-1];35 $selected_derivative = $current['derivatives'][$model];36 $img_all= $derivative->get_all($derivative->src_image);37 $template->append('current', array(38 'selected_derivative' => $selected_derivative39 ), true);40 41 42 $current = $template->get_template_vars('current');43 }44 $derivative=$current['selected_derivative'] ;45 $imgScaledWH=$derivative->src_image->get_size();46 $imgSizeWH = $derivative->get_size();47 $img_type = $derivative->get_type();48 $img_url = $derivative->get_url();49 $img_all= $derivative->get_all($derivative->src_image);50 $scaled_size=$derivative->get_size_hr(); //792 x 44151 $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"52 //================= taille mis a l'échelle53 $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)54 $src= $derivative->src_image ;55 56 }57 58 15 $img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480"; 59 16 $img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320"; … … 61 18 $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480"; 62 19 $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320"; 63 64 65 20 66 21 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height ; 67 22 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']: $img_width ; 23 24 $window_height= isset($_SESSION['windowHeight'])?$_SESSION['windowHeight']: $img_scaled_height ; 25 $window_width= isset($_SESSION['windowWidth'])?$_SESSION['windowWidth']: $img_scaled_width ; 68 26 69 $window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ;70 $window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width ;71 27 global $size ; 72 28 $size= array( … … 76 32 'window_width' => $window_width 77 33 ); 78 34 79 35 $my_path = AUTOSIZE_PATH_ABS; 80 36 $theme=$user['theme']; 37 38 81 39 $user_status = $user['status'] ; 82 40 … … 88 46 ); 89 47 if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_"; 48 //====================================================== 49 50 //=== type possible === 51 if(isset($defined_types)) 52 foreach ($defined_types as $type_size){ 53 $value = $type_size; 54 $options[$value] = $type_size; 55 } 56 57 //=========================================== 58 $template->assign( 59 array( 60 'select_type' =>$select_type, 61 'select_map' =>$select_type, 62 63 'pictureDeriv' =>$pictureDeriv , 64 65 'maxi_img' =>$maxi_img , 66 'ratio' =>$img_scaled_width/$img_scaled_height , 90 67 91 68 92 //======================================================93 94 $options['Autosize'] = ''.l10n('Autosize').'';95 foreach ($defined_types as $type_size){96 $value = $type_size;97 $options[$value] = $type_size;98 }99 //===================100 $value=0;101 $liste_type="";102 if(isset($img_all ))103 foreach ($img_all as $img_select){104 $imgSizeWH = $img_select->get_size();105 $img_type = $img_select->get_type();106 $img_url = $img_select->get_url();107 108 $liste_type .= $img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1]."|" ;109 if(strtolower($img_type)=="original") break ;110 111 112 }113 114 //===================================115 116 $template->assign(117 array(118 'ratio' =>$img_scaled_width/$img_scaled_height ,119 'cookies' => $cookies ,120 'deriv_type' =>$deriv_type ,121 'liste_type' => $liste_type ,122 69 'webmaster_type' => array( 123 70 'OPTIONS' => $options, … … 150 97 151 98 'theme' => $theme, 99 100 'windowHeight' => $window_height, 101 'windowWidth' => $window_width, 102 152 103 'SCALED_WIDTH' => $img_scaled_width, 153 104 'SCALED_HEIGHT' => $img_scaled_height, … … 158 109 'MINI_HEIGHT' => $autosize_parametres->mini_height, 159 110 'MINI_WIDTH' => $autosize_parametres->mini_width, 111 160 112 'MINI_HEIGHT2' => $autosize_parametres->mini_height2, 161 113 'MINI_WIDTH2' => $autosize_parametres->mini_width2, … … 176 128 177 129 'user_status' => get_user_status($user_status) , 178 'Size' => $size 179 130 'SRC_IMG' => $SRC_IMG, 131 'liste_type' => $liste_type , 132 'Size' => $size 180 133 181 134 )
Note: See TracChangeset
for help on using the changeset viewer.