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

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

[extensions] Autosize update to piwigo 2.5 (fix bugs with pamooramics, charlies's )

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