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

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

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

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