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

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

[extensions] Autosize fix compatibility with 2.4 (compatibility charlie's,iframe )

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      $options[$value] = $type_size;   
55    } 
56 $autosize_parametres = cl_autosize_Get_Options();
57 //===========================================
58$COOKIE_PATH= cookie_path() ;
59 global $DEBUG_autosize;
60
61          $user_type= get_user_status($user_status)."_type";
62          $user_type=  $autosize_parametres->$user_type ; 
63          $select_type=ImageStdParams::get_by_type($user_type);
64          $ideal_size  =  $select_type->sizing->ideal_size ; 
65          if($user_type=="Autosize" || $user_type=="SelMaxi"){
66              $ideal_size[0]=$imgSizeWH[0];
67              $ideal_size[1]=$imgSizeWH[1];
68          }
69
70 $slide_show = isset($page['slideshow'])?$page['slideshow']:false;
71
72        $template->assign(
73                                        array( 
74            'ideal_size_width' => $ideal_size[0] ,
75            'ideal_size_height' => $ideal_size[1] ,
76            'has_pamoorama' => $has_pamoorama,
77            'pictureMap' =>   $pictureDeriv ,
78            'pictureDeriv' =>   $pictureDeriv ,
79            'pictureSelType' => $pictureSelType,
80
81            'SRC_IMG' => $SRC_IMG,
82            'liste_type' => $liste_type ,
83            'COOKIE_PATH' =>  $COOKIE_PATH  ,
84            'slide_show' => $slide_show,
85             
86            'ratio' =>$imgSizeWH[0]/$imgSizeWH[1] ,   
87             
88            'webmaster_type' => array(
89                                            'OPTIONS' => $options,
90                                            'SELECTED' => $autosize_parametres->webmaster_type
91                                            ),
92            'admin_type' => array(
93                                            'OPTIONS' => $options,
94                                            'SELECTED' => $autosize_parametres->admin_type
95                                            ),
96            'generic_type' => array(
97                                            'OPTIONS' => $options,
98                                            'SELECTED' => $autosize_parametres->generic_type
99                                            ),
100            'guest_type' => array(
101                                            'OPTIONS' => $options,
102                                            'SELECTED' => $autosize_parametres->guest_type
103                                            ),
104            'normal_type' => array(
105                                            'OPTIONS' => $options,
106                                            'SELECTED' => $autosize_parametres->normal_type
107                                            ),
108
109            'DEBUG_autosize' =>  $DEBUG_autosize   ,
110            'cl_visible' =>  $cl_visible,
111            'cl_version' => $cl_version ,
112            'Version_pwg' => PHPWG_VERSION ,
113            'cl_plugin' => $cl_plugin,
114
115            'fade_in' => $autosize_parametres->fade_in,
116            'thumbnail' => $conf['prefix_thumbnail'],
117            'visible' => $visible,
118
119            'theme' => $theme,
120
121            'windowHeight' => $windowHeight,
122            'windowWidth' =>  $windowWidth,
123
124            'SCALED_WIDTH' => $imgSizeWH[0],
125            'SCALED_HEIGHT' => $imgSizeWH[1],     
126                         
127            'theImageWidth'     => isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']: $imgSizeWH[0],
128            'theImageHeight'    => isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$imgSizeWH[1],
129                   
130            'MINI_HEIGHT' => $autosize_parametres->mini_height,
131            'MINI_WIDTH'        => $autosize_parametres->mini_width,
132
133            'MINI_HEIGHT2' => $autosize_parametres->mini_height2,
134            'MINI_WIDTH2'       => $autosize_parametres->mini_width2,
135
136            'MARGE_BASSE' => $autosize_parametres->marge_basse,
137            'ECHELLE_MAX' => $autosize_parametres->echelle_max,
138
139       
140            'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"'  : ''  ,
141            'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"'  : '' ,
142            'defaut_type' => ($autosize_parametres->defaut_type == 'on') ? 'checked="defaut_type"'  : '' ,
143
144            'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"'  : '' ,
145            'admin_enabled' => ($autosize_parametres->admin_enabled == 'on') ? 'checked="checked"'  : '' ,
146            'generic_enabled' => ($autosize_parametres->generic_enabled == 'on') ? 'checked="checked"'  : '' ,
147            'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"'  : '' ,     
148            'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"'  : '' ,
149
150            'user_status'   => get_user_status($user_status)  ,
151
152            'Size' => $size       
153                                       
154                                 )
155                                );     
156
157                           
158 //unset($_POST);
159?>
Note: See TracBrowser for help on using the repository browser.