Dotclear


Ignore:
Timestamp:
10/16/13 23:23:09 (12 years ago)
Author:
Lepeltier kévin <kevin@…>
Branch:
widgets
Children:
2413:6af4dde5a9c0, 2414:850136421c06
Message:

widgets : On enlève advanced settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/class.widgets.php

    r2395 r2412  
    139139     public $append_callback = null; 
    140140     private $settings = array(); 
    141      private $advance_id; 
    142      private $advanced_settings = array(); 
    143141      
    144142     public function serialize($order) { 
     
    146144          foreach ($this->settings as $k=>$v) 
    147145               $values[$k]=$v['value']; 
    148           foreach ($this->advanced_settings as $k=>$v) 
    149                $values[$k]=$v['value']; 
    150146          $values['id']=$this->id; 
    151147          $values['order']=$order; 
     
    193189     public function __get($n) 
    194190     { 
    195           $setting = null; 
    196191          if (isset($this->settings[$n])) { 
    197                $setting = $this->settings[$n]['value']; 
    198           } else if (isset($this->advanced_settings[$n])) { 
    199                $setting = $this->advanced_settings[$n]['value']; 
    200           } 
    201           return $setting; 
     192               return $this->settings[$n]['value']; 
     193          } 
     194          return null; 
    202195     } 
    203196      
     
    206199          if (isset($this->settings[$n])) { 
    207200               $this->settings[$n]['value'] = $v; 
    208           } else if (isset($this->advanced_settings[$n])) { 
    209                $this->advanced_settings[$n]['value'] = $v; 
    210201          } 
    211202     } 
     
    231222     } 
    232223      
    233      public function advanced_setting($name,$title,$value,$type='text') 
    234      { 
    235           if ($type == 'combo' || $type == 'radio') { 
    236                $options = @func_get_arg(4); 
    237                if (!is_array($options)) { 
    238                     return false; 
    239                } 
    240           } 
    241            
    242           $this->advanced_settings[$name] = array( 
    243                'title' => $title, 
    244                'type' => $type, 
    245                'value' => $value 
    246           ); 
    247            
    248           if (isset($options)) { 
    249                $this->advanced_settings[$name]['options'] = $options; 
    250           } 
    251      } 
    252       
    253      public function advance_settings() 
    254      { 
    255           return $this->advanced_settings; 
    256      } 
    257       
    258224     public function settings() 
    259225     { 
     
    268234               $res .= $this->formSetting($id,$s,$pr,$i=0); 
    269235               $i++; 
    270           } 
    271            
    272           if ( count($this->advanced_settings) > 0 ) 
    273           { 
    274                $res .= '<div class="widgetAdvancedSettings">'; 
    275                $res .= '<h5>'.__('Réglages avancés').'</h5>'; 
    276            
    277                foreach ($this->advanced_settings as $id => $s) 
    278                { 
    279                     $res .= $this->formSetting($id,$s,$pr,$i); 
    280                     $i++; 
    281                } 
    282                 
    283                $res .= '</div>'; 
    284236          } 
    285237           
Note: See TracChangeset for help on using the changeset viewer.

Sites map