Ignore:
Timestamp:
Nov 6, 2010, 4:43:08 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] Improvement compatibility Gmaps, rvmaps,pamooramic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/autosize.inc.php

    r7642 r7669  
    4646                                $autosize_parametres = cl_autosize_Get_Options();
    4747                                include (AUTOSIZE_PATH."include/affiche.php"); 
    48                                 $debug = isset($conf['debug']) ? $conf['debug'] : 'false' ;
     48                                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    4949                                $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ;
    5050                               
     
    9999                 global $template,$infos_message,$erreur_message, $user ;
    100100                global  $conf,$lang ;
    101 
     101       
    102102                 //==============================================================
    103103                  if (isset($erreur_message))
     
    130130 * conflit =============================================
    131131 */
     132 static public function cl_autosize_script_2($pictures)
     133 {
     134           global  $template,$user,$conf,$picture ;
     135
     136                $my_path =  basename(dirname(__FILE__)).'/' ;
     137            $my_path = dirname(__FILE__).'/';
     138                $template->set_filenames(
     139                     array('autosize_init'=>$my_path. "template/cl_conflit.tpl" 
     140                         )
     141                      );                 
     142                $template->assign(
     143                                                array('AUTOSIZE_ROOT' => AUTOSIZE_PATH)
     144                                                 );
     145
     146                 
     147                return $pictures;
     148 }
    132149        static public function cl_autosize_script()
    133150        {
     
    135152
    136153                $my_path =  basename(dirname(__FILE__)).'/' ;
    137         $my_path = dirname(__FILE__).'/';
     154            $my_path = dirname(__FILE__).'/';
    138155                $template->set_filenames(
    139156                     array('autosize_init'=>$my_path. "template/conflit.tpl" 
     
    148165       
    149166        }// function cl_autosize_script
    150         static public function cl_add_css(){
    151             global  $template,$user,$conf,$picture ;
    152                 $path = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/';
    153                 $template->append('head_elements', '
    154                         <link rel="stylesheet" type="text/css" href="'.$path.'css/autosize.css">
    155                         <script type="text/javascript" src="'.$path.'js/css.js"></script>
    156                         <script type="text/javascript">
    157                                  
    158                         </script>'
    159                 );
    160         }
    161167        /*
    162168        *
     
    165171           global  $template,$user,$conf,$picture ;
    166172                        $my_path = realpath(AUTOSIZE_PATH .'/');
    167                         $userdata=$user;
    168                         $fields = array( 'maxwidth', 'maxheight' );
     173         $userdata=$user;
     174         $fields = array( 'maxwidth', 'maxheight' );
    169175         
    170                         $ThePicture = $template->get_template_vars('current');
     176         $ThePicture = $template->get_template_vars('current');
    171177                        $data = array();
    172178                       
    173179
    174                 return $content;
     180 return $content;
    175181
    176182                        $data['maxwidth'] = '1200';
    177                         $data['maxheight'] ='250';
     183$data['maxheight'] ='250';
    178184                        $data['user_id'] = $userdata['id'];
    179                         foreach ($fields as $field){
    180                                 if (isset($_POST[$field])){
    181                                                 $data[$field] = $_POST[$field];
    182                                                 }
    183                                 }
     185           foreach ($fields as $field)
     186      {
     187        if (isset($_POST[$field]))
     188        {
     189          $data[$field] = $_POST[$field];
     190        }
     191      }
    184192       
    185         if($data['maxwidth'] != "" ){
     193        if($data['maxwidth'] != "" )
     194{
    186195        $picture['current']['scaled_width']=$data['maxwidth'];
    187196                 $picture['current']['scaled_height']=$data['maxheight'];
    188                                         mass_updates(USER_INFOS_TABLE,
    189                                         array('primary' => array('user_id'), 'update' => $fields),
    190                                         array($data));
    191                                 }
     197       mass_updates(USER_INFOS_TABLE,
     198                   array('primary' => array('user_id'), 'update' => $fields),
     199                   array($data));
     200       
     201}
     202
     203 
    192204   return $content;
    193205   /*
    194                         $template->assign(
     206 $template->assign(
    195207                                                array(
    196208                                                'AUTOSIZE_PATH' => $my_path,
     
    199211                                                 );
    200212 
    201                                 $template->parse( 'autosize_cl_init', false);
    202                                 return $content;
     213                $template->parse( 'autosize_cl_init', false);
     214        return $content;
    203215        */
    204216
Note: See TracChangeset for help on using the changeset viewer.