Dotclear

Changeset 517:7a334cf98e87 for inc/admin


Ignore:
Timestamp:
07/06/11 08:58:51 (14 years ago)
Author:
Dsls <dsls@…>
Branch:
formfilters
Message:

Added filter name, fixed php notice in filters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/class.dc.filter.php

    r506 r517  
    169169                         $ret .= $filter->getFormLine(); 
    170170                    } 
    171                     $form_combo[$filter->desc]=$filter->id; 
     171                    $form_combo[$filter->name]=$filter->id; 
    172172                    $count++; 
    173173               } 
     
    237237*/ 
    238238abstract class Filter { 
    239      public $id;                        ///< <b>string</b> field id (local to fieldset) 
    240      public $desc;                 ///< <b>string</b> field description 
    241      protected $request_param;     ///< <b>string</b> resulting parameter array key 
    242      protected $enabled;           ///< <b>string</b> true if filter is enabled 
    243      protected $values;            ///< <b>array</b> possible filter values 
    244      public $field_id;             ///< <b>string</b> field id (global to the page) 
     239     public $id;                        ///<b>string</b> field id (local to fieldset) 
     240     public $name;                 ///<b>string</b> filter name 
     241     public $desc;                 ///<b>string</b> field description 
     242     protected $request_param;     ///<b>string</b> resulting parameter array key 
     243     protected $enabled;           ///<b>string</b> true if filter is enabled 
     244     protected $values;            ///<b>array</b> possible filter values 
     245     public $field_id;             ///<b>string</b> field id (global to the page) 
    245246      
    246247     /** 
     
    250251     @param    form_prefix    <b>string</b>       form prefix to use for parameters 
    251252     */ 
    252      public function __construct ($id,$desc,$request_param) { 
     253     public function __construct ($id,$name,$desc,$request_param) { 
    253254          $this->id = $id; 
     255          $this->name=$name; 
    254256          $this->desc = $desc; 
    255257          $this->request_param = $request_param; 
     
    413415     protected $extra; 
    414416      
    415      public function __construct($id,$desc,$request_param,$options,$extra=array()) { 
    416           parent::__construct($id,$desc,$request_param); 
     417     public function __construct($id,$name,$desc,$request_param,$options,$extra=array()) { 
     418          parent::__construct($id,$name,$desc,$request_param); 
    417419          $this->options = $options; 
    418420          $this->extra = $extra; 
     
    496498     protected $options; 
    497499      
    498      public function __construct($id,$desc,$request_param,$options,$extra=array()) { 
    499           parent::__construct($id,$desc,$request_param); 
     500     public function __construct($id,$name,$desc,$request_param,$options,$extra=array()) { 
     501          parent::__construct($id,$name,$desc,$request_param); 
    500502          $this->options = $options; 
    501503          $this->values=array(); 
     
    508510     public function add() { 
    509511          parent::add(); 
    510           $this->values[]=$options[0]; 
     512          $this->values=current($this->options); 
    511513     } 
    512514 
     
    527529     protected $max; 
    528530      
    529      public function __construct($id,$desc,$request_param,$size,$max) { 
    530           parent::__construct($id,$desc,$request_param); 
     531     public function __construct($id,$name,$desc,$request_param,$size,$max) { 
     532          parent::__construct($id,$name,$desc,$request_param); 
    531533          $this->options = $options; 
    532534          $this->values=array(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map