Ignore:
Timestamp:
Oct 22, 2012, 4:47:26 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4, add option: SelMax / Autosize (default setting)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/include/affiche.php

    r18325 r18716  
    66$cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] :
    77(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 ;
    128//===========================================================================
    139$cookies="' x '";
     10global $imgSizeWH ;
     11$windowHeight=$_COOKIE['windowHeight'];
     12$windowWidth=$_COOKIE['windowWidth'];
     13global $size ;
    1414
    15 $img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480";
    16 $img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320";
    17 
    18 $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480";
    19 $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320";
     15if(!isset($imgSizeWH)){
     16 $imgSizeWH[0]=100;
     17$imgSizeWH[1]=100;
     18}
    2019 
    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  
    24 $window_height= isset($_SESSION['windowHeight'])?$_SESSION['windowHeight']: $img_scaled_height ;
    25 $window_width= isset($_SESSION['windowWidth'])?$_SESSION['windowWidth']: $img_scaled_width    ;
    26 
    27 global $size ;
    2820$size=  array(
    29             'src_img_h' => $src_img_h,
    30             'src_img_w' => $src_img_w,
    31             'window_height' =>$window_height,
    32             'window_width' => $window_width
     21            'src_img_h' => $imgSizeWH[1],
     22            'src_img_w' => $imgSizeWH[0],
     23            'window_height' =>$windowHeight,
     24            'window_width' => $windowWidth
    3325          );
    34        
     26   
     27       
    3528  $my_path = AUTOSIZE_PATH_ABS;
    3629  $theme=$user['theme'];
     
    4942
    5043//=== type possible ===
     44 $defined_types = array_keys(ImageStdParams::get_defined_type_map());     
    5145if(isset($defined_types))
    5246    foreach ($defined_types as $type_size){
     
    5448      $options[$value] = $type_size;   
    5549    } 
    56 
     50 $autosize_parametres = cl_autosize_Get_Options();
    5751 //===========================================
     52$COOKIE_PATH= cookie_path() ;
     53 global $DEBUG_autosize;
     54     
    5855        $template->assign(
    5956                                        array( 
    60             'select_type' =>$select_type,
    61             'select_map' =>$select_type,
    62             'pictureDeriv' =>$pictureDeriv ,
    63             'maxi_img' =>$maxi_img ,
    64             'ratio' =>$img_scaled_width/$img_scaled_height ,     
     57            'has_pamoorama' => $has_pamoorama,
     58            'pictureMap' =>   $pictureDeriv ,
     59            'pictureDeriv' =>   $pictureDeriv ,
     60            'pictureSelType' => $pictureSelType,
     61
     62            'SRC_IMG' => $SRC_IMG,
     63            'liste_type' => $liste_type ,
     64            'COOKIE_PATH' =>  $COOKIE_PATH  ,
     65             
     66            'ratio' =>$imgSizeWH[0]/$imgSizeWH[1] ,   
     67             
    6568            'webmaster_type' => array(
    6669                                            'OPTIONS' => $options,
     
    8386                                            'SELECTED' => $autosize_parametres->normal_type
    8487                                            ),
     88
    8589            'DEBUG_autosize' =>  $DEBUG_autosize   ,
    8690            'cl_visible' =>  $cl_visible,
     
    9498            'theme' => $theme,
    9599
    96             'windowHeight' => $window_height,
    97             'windowWidth' =>  $window_width,
     100            'windowHeight' => $windowHeight,
     101            'windowWidth' =>  $windowWidth,
    98102
    99             'SCALED_WIDTH' => $img_scaled_width,
    100             'SCALED_HEIGHT' => $img_scaled_height,     
     103            'SCALED_WIDTH' => $imgSizeWH[0],
     104            'SCALED_HEIGHT' => $imgSizeWH[1],     
    101105                         
    102             'IMG_WIDTH'         => $img_width,
    103             'IMG_HEIGHT'        => $img_height,
     106            'theImageWidth'     => isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']: $imgSizeWH[0],
     107            'theImageHeight'    => isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$imgSizeWH[1],
    104108                   
    105109            'MINI_HEIGHT' => $autosize_parametres->mini_height,
     
    115119            'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"'  : ''  ,
    116120            'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"'  : '' ,
    117 
     121            'defaut_type' => ($autosize_parametres->defaut_type == 'on') ? 'checked="defaut_type"'  : '' ,
    118122
    119123            'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"'  : '' ,
     
    124128
    125129            'user_status'   => get_user_status($user_status)  ,
    126             'SRC_IMG' => $SRC_IMG,
    127             'liste_type' => $liste_type ,
     130
    128131            'Size' => $size       
    129132                                       
Note: See TracChangeset for help on using the changeset viewer.