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

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

[extensions] Autosize update to piwigo 2.5 (fix bugs in admin )

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