Changeset 16931 for extensions/Autosize/include
- Timestamp:
- Jul 23, 2012, 3:01:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/include/affiche.php
r16124 r16931 12 12 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 13 13 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 14 //================================================================================================= 14 //=========================================================================== 15 $cookies="' x '"; 15 16 16 $img_width=isset($picture['current']['width'])?$picture['current']['width']:"480"; 17 $img_height=isset($picture['current']['height'])?$picture['current']['height']:"320"; 18 $img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:"480"; 19 $img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:"320"; 17 $current = $template->get_template_vars('current'); 18 if (isset($_COOKIE['picture_deriv'])) 19 { 20 if (isset($_COOKIE['img_w'])) 21 $cookies = '"'.$_COOKIE['img_w']." x ". $_COOKIE['img_h'] .'"'; 20 22 21 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height ; 22 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']: $img_width ; 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 31 if (isset($current)){ 32 $derivative=$current['selected_derivative'] ; 33 $imgScaledWH=$derivative->src_image->get_size(); 34 $imgSizeWH = $derivative->get_size(); 35 $img_type = $derivative->get_type(); 36 $img_url = $derivative->get_url(); 37 $img_all= $derivative->get_all($derivative->src_image); 38 $scaled_size=$derivative->get_size_hr(); //792 x 441 39 $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441" 40 //================= taille mis a l'échelle 41 $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55) 42 $src= $derivative->src_image ; 43 44 } 45 46 $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 47 48 49 50 $img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480"; 51 $img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320"; 52 53 $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480"; 54 $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320"; 55 56 57 58 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height ; 59 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']: $img_width ; 60 23 61 $window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ; 24 62 $window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width ; … … 41 79 ) 42 80 ); 43 44 if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_"; 81 if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_"; 82 83 84 //====================================================== 85 86 $options['Autosize'] = ''.l10n('Autosize').''; 87 foreach ($defined_types as $type_size){ 88 $value = $type_size; 89 $options[$value] = $type_size; 90 } 91 //====================================================== 92 45 93 $template->assign( 46 array( 94 array( 95 'ratio' =>$img_scaled_width/$img_scaled_height , 96 'cookies' => $cookies , 97 'deriv_type' =>$deriv_type , 98 'webmaster_type' => array( 99 'OPTIONS' => $options, 100 'SELECTED' => $autosize_parametres->webmaster_type 101 ), 102 'admin_type' => array( 103 'OPTIONS' => $options, 104 'SELECTED' => $autosize_parametres->admin_type 105 ), 106 'generic_type' => array( 107 'OPTIONS' => $options, 108 'SELECTED' => $autosize_parametres->generic_type 109 ), 110 'guest_type' => array( 111 'OPTIONS' => $options, 112 'SELECTED' => $autosize_parametres->guest_type 113 ), 114 'normal_type' => array( 115 'OPTIONS' => $options, 116 'SELECTED' => $autosize_parametres->normal_type 117 ), 47 118 'DEBUG_autosize' => $DEBUG_autosize , 48 119 'cl_visible' => $cl_visible, … … 56 127 'theme' => $theme, 57 128 'SCALED_WIDTH' => $img_scaled_width, 58 'SCALED_HEIGHT' => $img_scaled_height, 129 'SCALED_HEIGHT' => $img_scaled_height, 130 59 131 'IMG_WIDTH' => $img_width, 60 132 'IMG_HEIGHT' => $img_height, … … 68 140 'ECHELLE_MAX' => $autosize_parametres->echelle_max, 69 141 70 'check_auto_w' => ($autosize_parametres->check_auto_w == 'on') ? 'checked="checked"' : '' ,71 'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"' : '' ,142 143 'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"' : '' , 72 144 'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"' : '' , 73 145 74 'webmaster_width' => $autosize_parametres->webmaster_width, 75 'webmaster_height' => $autosize_parametres->webmaster_height, 146 76 147 'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"' : '' , 77 78 'admin_width' => $autosize_parametres->admin_width,79 'admin_height' => $autosize_parametres->admin_height,80 148 'admin_enabled' => ($autosize_parametres->admin_enabled == 'on') ? 'checked="checked"' : '' , 81 82 'generic_width' => $autosize_parametres->generic_width,83 'generic_height' => $autosize_parametres->generic_height,84 149 'generic_enabled' => ($autosize_parametres->generic_enabled == 'on') ? 'checked="checked"' : '' , 85 86 'guest_width' => $autosize_parametres->guest_width, 87 'guest_height' => $autosize_parametres->guest_height, 88 'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"' : '' , 89 90 'normal_width' => $autosize_parametres->normal_width, 91 'normal_height' => $autosize_parametres->normal_height, 150 'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"' : '' , 92 151 'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"' : '' , 93 152
Note: See TracChangeset
for help on using the changeset viewer.