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

Last change on this file since 18724 was 18724, checked in by cljosse, 12 years ago

[extensions] Autosize fix compatibility with 2.4 (init picture)

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