Ignore:
Timestamp:
Nov 30, 2010, 9:01:46 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] fix bug cl_conflit/autosize

File:
1 edited

Legend:

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

    r7912 r7943  
    4343                if (isset( $page['body_id'])  ) {
    4444                if ( $page['body_id']=='thePicturePage'  ) {
    45                         if ( isset($picture['current'])){
    46                                
     45                        if ( isset($picture['current'])){                               
    4746                                $autosize_parametres = cl_autosize_Get_Options();
    4847                                include (AUTOSIZE_PATH."include/affiche.php"); 
     
    139138                $my_path = dirname(__FILE__).'/';
    140139                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    141                 $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
    142 
     140               
    143141                $ThePicture = $template->get_template_vars('current');
    144142                $tpl_name =   $user['theme'] ;
     
    162160 {
    163161           global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    164            //userDefManage ??
     162         
    165163                        $my_path =  basename(dirname(__FILE__)).'/' ;
    166164                        $my_path = dirname(__FILE__).'/';
    167165                        $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    168                         $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
     166                       
    169167                        $theme=$user['theme'];
    170168                        $template->assign(
     
    173171                                        'name' => $cl_plugin['name'] ,
    174172                                        'ma_page' =>    $page['body_id'],
    175                                         'cl_conflit' => $cl_conflit  ,
     173                                       
    176174                                        'theme' => $theme  ,
    177175                                        'DEBUG' => $debug   ,
     
    182180$autoscript="<script type='text/javascript'>
    183181if (typeof (save_framework) == 'function')
    184 save_framework('".$page['body_id']."');
     182   save_framework('".$page['body_id']."');
    185183</script>";
    186184                         $template->append('footer_elements',$autoscript); 
     
    199197                $template->set_filenames(array('autosize_init'=>$my_path. "template/conflit.tpl" ) );   
    200198                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    201                 $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;                     
     199               
    202200                $theme=$user['theme'];
    203201                         
     
    206204                                                'cl_version' => $cl_plugin['version'] ,
    207205                                                'name' => $cl_plugin['name'] ,
    208                                                 'cl_conflit' => $cl_conflit  ,
     206                                               
    209207                                                'theme' => $theme  ,
    210208                                                'DEBUG' => $debug   ,
     
    220218*/
    221219static public function cl_ajuste_data($content){
    222            global  $template,$user,$conf,$picture ;
    223          $my_path = realpath(AUTOSIZE_PATH .'/');
    224          $userdata=$user;
    225          $fields = array( 'maxwidth', 'maxheight' );
     220        global  $template,$user,$conf,$picture ;
     221        $my_path = realpath(AUTOSIZE_PATH .'/');
     222        $userdata=$user;
     223        $fields = array( 'maxwidth', 'maxheight' );
    226224         
    227          $ThePicture = $template->get_template_vars('current');
    228                         $data = array();
    229                        
    230                          
    231 
     225        $ThePicture = $template->get_template_vars('current');
     226        $data = array();
    232227 return $content;
    233228
    234                         $data['maxwidth'] = '1200';
    235 $data['maxheight'] ='250';
    236                         $data['user_id'] = $userdata['id'];
    237            foreach ($fields as $field)
    238       {
    239         if (isset($_POST[$field]))
    240         {
    241           $data[$field] = $_POST[$field];
    242         }
    243       }
     229        $data['maxwidth'] = '1200';
     230        $data['maxheight'] ='250';
     231        $data['user_id'] = $userdata['id'];
     232        foreach ($fields as $field)
     233        {
     234                if (isset($_POST[$field]))
     235                {
     236                        $data[$field] = $_POST[$field];
     237                }
     238        }
    244239       
    245240        if($data['maxwidth'] != "" )
    246 {
    247         $picture['current']['scaled_width']=$data['maxwidth'];
    248                  $picture['current']['scaled_height']=$data['maxheight'];
    249        mass_updates(USER_INFOS_TABLE,
    250                    array('primary' => array('user_id'), 'update' => $fields),
    251                    array($data));
    252        
    253 }
    254 
    255  
    256                 return $content;
    257    /*
    258                 $template->assign(
    259                                                 array(
    260                                                 'AUTOSIZE_PATH' => $my_path,
    261                                                                                         )
    262                                                  );
    263  
    264                 $template->parse( 'autosize_cl_init', false);
    265                 return $content;
    266         */
    267 
    268                                                                                  
     241                {
     242                $picture['current']['scaled_width']=$data['maxwidth'];
     243                $picture['current']['scaled_height']=$data['maxheight'];
     244                mass_updates(USER_INFOS_TABLE,
     245                                array('primary' => array('user_id'), 'update' => $fields),
     246                                array($data)); 
     247                }
     248                 
     249                return $content;                                                                                 
    269250         }
    270251
Note: See TracChangeset for help on using the changeset viewer.