source: extensions/Autosize/include/affiche.php @ 19844

Last change on this file since 19844 was 19844, checked in by cljosse, 11 years ago

[extensions] Autosize fix bug crop

File size: 6.3 KB
Line 
1<?php 
2
3$visible=(isset($visible))?$visible:false; 
4global $cl_version,$cl_plugin;
5
6$cl_version=isset($cl_version)?$cl_version:"";
7$cl_plugin=isset($cl_plugin)?$cl_plugin:"";
8
9$cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 
10(isset($_GET['cl_visible'])?$_GET['cl_visible']:'true'); 
11//===========================================================================
12$cookies="' x '"; 
13global $imgSizeWH ;
14if(isset($_COOKIE['windowHeight'])){
15$windowHeight=$_COOKIE['windowHeight'];
16$windowWidth=$_COOKIE['windowWidth'];
17}else{
18$windowHeight=600;
19$windowWidth=800;
20}
21global $size ;
22
23if(!isset($imgSizeWH)){
24 $imgSizeWH[0]=100;
25$imgSizeWH[1]=100;
26}
27 
28$size=  array(
29            'src_img_h' => $imgSizeWH[1],
30            'src_img_w' => $imgSizeWH[0],
31            'window_height' =>$windowHeight,
32            'window_width' => $windowWidth
33          );
34   
35       
36  $my_path = AUTOSIZE_PATH_ABS;
37  $theme=$user['theme'];
38 
39  $user_status = $user['status'] ;
40                   $template->assign( array( 
41                   'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
42                   'ROOT_URL' => ROOT_URL,
43                   'AUTOSIZE_PATH' => AUTOSIZE_PATH
44                                                                                        )
45                                                                        );     
46if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_";   
47//======================================================   
48
49//=== type possible ===
50 $defined_types = array_keys(ImageStdParams::get_defined_type_map());     
51if(isset($defined_types))
52    foreach ($defined_types as $type_size){
53      $value = $type_size;
54      if($type_size != "square" && $type_size != "thumb" )
55      $options[$value] = $type_size;   
56    } 
57 $autosize_parametres = cl_autosize_Get_Options();
58 //===========================================
59$COOKIE_PATH= cookie_path() ;
60 global $DEBUG_autosize;
61
62          $user_type= get_user_status($user_status)."_type";
63          $user_type=  $autosize_parametres->$user_type ; 
64          $select_type=ImageStdParams::get_by_type($user_type);
65          $ideal_size  =  $select_type->sizing->ideal_size ; 
66          if($user_type=="Autosize" || $user_type=="SelMaxi"){
67              $ideal_size[0]=$imgSizeWH[0];
68              $ideal_size[1]=$imgSizeWH[1];
69          }
70
71 $slide_show = isset($page['slideshow'])?$page['slideshow']:false;
72
73        $template->assign(
74                                        array( 
75            'ideal_size_width' => $ideal_size[0] ,
76            'ideal_size_height' => $ideal_size[1] ,
77            'has_pamoorama' => $has_pamoorama,
78            'pictureMap' =>   $pictureDeriv ,
79            'pictureDeriv' =>   $pictureDeriv ,
80            'pictureSelType' => $pictureSelType,
81
82            'SRC_IMG' => $SRC_IMG,
83            'liste_type' => $liste_type ,
84            'COOKIE_PATH' =>  $COOKIE_PATH  ,
85            'slide_show' => $slide_show,
86             
87            'ratio' =>$imgSizeWH[0]/$imgSizeWH[1] ,   
88             
89            'webmaster_type' => array(
90                                            'OPTIONS' => $options,
91                                            'SELECTED' => $autosize_parametres->webmaster_type
92                                            ),
93            'admin_type' => array(
94                                            'OPTIONS' => $options,
95                                            'SELECTED' => $autosize_parametres->admin_type
96                                            ),
97            'generic_type' => array(
98                                            'OPTIONS' => $options,
99                                            'SELECTED' => $autosize_parametres->generic_type
100                                            ),
101            'guest_type' => array(
102                                            'OPTIONS' => $options,
103                                            'SELECTED' => $autosize_parametres->guest_type
104                                            ),
105            'normal_type' => array(
106                                            'OPTIONS' => $options,
107                                            'SELECTED' => $autosize_parametres->normal_type
108                                            ),
109
110            'DEBUG_autosize' =>  $DEBUG_autosize   ,
111            'cl_visible' =>  $cl_visible,
112            'cl_version' => $cl_version ,
113            'Version_pwg' => PHPWG_VERSION ,
114            'cl_plugin' => $cl_plugin,
115
116            'fade_in' => $autosize_parametres->fade_in,
117            'thumbnail' => $conf['prefix_thumbnail'],
118            'visible' => $visible,
119
120            'theme' => $theme,
121
122            'windowHeight' => $windowHeight,
123            'windowWidth' =>  $windowWidth,
124
125            'SCALED_WIDTH' => $imgSizeWH[0],
126            'SCALED_HEIGHT' => $imgSizeWH[1],     
127                         
128            'theImageWidth'     => isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']: $imgSizeWH[0],
129            'theImageHeight'    => isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$imgSizeWH[1],
130                   
131            'MINI_HEIGHT' => $autosize_parametres->mini_height,
132            'MINI_WIDTH'        => $autosize_parametres->mini_width,
133
134            'MINI_HEIGHT2' => $autosize_parametres->mini_height2,
135            'MINI_WIDTH2'       => $autosize_parametres->mini_width2,
136
137            'MARGE_BASSE' => $autosize_parametres->marge_basse,
138            'ECHELLE_MAX' => $autosize_parametres->echelle_max,
139
140       
141            'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"'  : ''  ,
142            'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"'  : '' ,
143            'defaut_type' => ($autosize_parametres->defaut_type == 'on') ? 'checked="defaut_type"'  : '' ,
144
145            'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"'  : '' ,
146            'admin_enabled' => ($autosize_parametres->admin_enabled == 'on') ? 'checked="checked"'  : '' ,
147            'generic_enabled' => ($autosize_parametres->generic_enabled == 'on') ? 'checked="checked"'  : '' ,
148            'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"'  : '' ,     
149            'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"'  : '' ,
150
151            'user_status'   => get_user_status($user_status)  ,
152
153            'Size' => $size       
154                                       
155                                 )
156                                );     
157
158                           
159 //unset($_POST);
160?>
Note: See TracBrowser for help on using the repository browser.