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

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

[extensions] Autosize fix compatibility with 2.4, add theme directive

File size: 5.7 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$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 ; 
12//===========================================================================
13$cookies="' x '"; 
14
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";
20 
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
27global $size ;
28$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
33          );
34       
35  $my_path = AUTOSIZE_PATH_ABS;
36  $theme=$user['theme'];
37
38
39  $user_status = $user['status'] ;
40
41                   $template->assign( array( 
42                   'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
43                   'ROOT_URL' => ROOT_URL,
44                   'AUTOSIZE_PATH' => AUTOSIZE_PATH,
45                                                                                        )
46                                                                        );     
47if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_";   
48//======================================================   
49
50//=== type possible ===
51if(isset($defined_types))
52    foreach ($defined_types as $type_size){
53      $value = $type_size;
54      $options[$value] = $type_size;   
55    } 
56
57 //===========================================
58        $template->assign(
59                                        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 ,     
65            'webmaster_type' => array(
66                                            'OPTIONS' => $options,
67                                            'SELECTED' => $autosize_parametres->webmaster_type
68                                            ),
69            'admin_type' => array(
70                                            'OPTIONS' => $options,
71                                            'SELECTED' => $autosize_parametres->admin_type
72                                            ),
73            'generic_type' => array(
74                                            'OPTIONS' => $options,
75                                            'SELECTED' => $autosize_parametres->generic_type
76                                            ),
77            'guest_type' => array(
78                                            'OPTIONS' => $options,
79                                            'SELECTED' => $autosize_parametres->guest_type
80                                            ),
81            'normal_type' => array(
82                                            'OPTIONS' => $options,
83                                            'SELECTED' => $autosize_parametres->normal_type
84                                            ),
85            'DEBUG_autosize' =>  $DEBUG_autosize   ,
86            'cl_visible' =>  $cl_visible,
87            'cl_version' => $cl_version,
88            'cl_plugin' => $cl_plugin,
89
90            'fade_in' => $autosize_parametres->fade_in,
91            'thumbnail' => $conf['prefix_thumbnail'],
92            'visible' => $visible,
93
94            'theme' => $theme,
95
96            'windowHeight' => $window_height,
97            'windowWidth' =>  $window_width,
98
99            'SCALED_WIDTH' => $img_scaled_width,
100            'SCALED_HEIGHT' => $img_scaled_height,     
101                         
102            'IMG_WIDTH'         => $img_width,
103            'IMG_HEIGHT'        => $img_height,
104                   
105            'MINI_HEIGHT' => $autosize_parametres->mini_height,
106            'MINI_WIDTH'        => $autosize_parametres->mini_width,
107
108            'MINI_HEIGHT2' => $autosize_parametres->mini_height2,
109            'MINI_WIDTH2'       => $autosize_parametres->mini_width2,
110
111            'MARGE_BASSE' => $autosize_parametres->marge_basse,
112            'ECHELLE_MAX' => $autosize_parametres->echelle_max,
113
114       
115            'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"'  : ''  ,
116            'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"'  : '' ,
117
118
119            'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"'  : '' ,
120            'admin_enabled' => ($autosize_parametres->admin_enabled == 'on') ? 'checked="checked"'  : '' ,
121            'generic_enabled' => ($autosize_parametres->generic_enabled == 'on') ? 'checked="checked"'  : '' ,
122            'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"'  : '' ,     
123            'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"'  : '' ,
124
125            'user_status'   => get_user_status($user_status)  ,
126            'SRC_IMG' => $SRC_IMG,
127            'liste_type' => $liste_type ,
128            'Size' => $size       
129                                       
130                                 )
131                                );     
132
133                           
134 //unset($_POST);
135?>
Note: See TracBrowser for help on using the repository browser.