Dotclear

Changeset 1472:994f097572a6


Ignore:
Timestamp:
08/19/13 11:48:41 (11 years ago)
Author:
Dsls
Branch:
default
Message:

FieldsList? class documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/posts_actions.php

    r1471 r1472  
    1717$params = array(); 
    1818 
     19/** 
     20* FieldsList - Compatibility class for hidden fields & entries[] fields 
     21* 
     22*/ 
    1923class FieldsList { 
     24     /** @var array list of hidden fields */ 
    2025     protected $hidden; 
     26     /** @var array list of selected entries */ 
    2127     protected $entries; 
     28 
     29 
     30   /** 
     31     * Class constructor 
     32     */ 
    2233     public function __construct() { 
    2334          $this->hidden=array(); 
    2435          $this->entries =array(); 
    2536     } 
    26      public function addHidden($name,$value) { 
     37 
     38    /** 
     39     * addHidden - adds a hidden field 
     40     *  
     41     * @param string $name the field name. 
     42     * @param mixed $value the field value. 
     43     * 
     44     * @access public 
     45      * @return the FieldsList instance, enabling to chain requests 
     46     */    
     47      public function addHidden($name,$value) { 
    2748          $this->hidden[] = form::hidden($name,$value); 
    2849          return $this; 
    2950     } 
    30      public function addEntry($id,$title) { 
     51 
     52    /** 
     53     * addEntry - adds a antry field 
     54     *  
     55     * @param string $id the entry id. 
     56     * @param mixed $title the entry title. 
     57     * 
     58     * @access public 
     59      * @return the FieldsList instance, enabling to chain requests 
     60     */    
     61      public function addEntry($id,$title) { 
    3162          $this->entries[$id]=$title; 
    3263          return $this; 
    3364     } 
    3465 
    35      public function getHidden() { 
     66    /** 
     67     * getHidden - returns the list of hidden fields, html encoded 
     68     * 
     69     * @access public 
     70      * @return the list of hidden fields, html encoded 
     71     */ 
     72      public function getHidden() { 
    3673          return join('',$this->hidden); 
    3774     } 
    3875      
     76    /** 
     77     * getEntries - returns the list of entry fields, html encoded 
     78     * 
     79      * @param boolean $hidden if set to true, returns entries as a list of hidden field 
     80      *                if set to false, returns html code displaying the list of entries 
     81      *                with a list of checkboxes to enable to select/deselect entries 
     82     * @access public 
     83      * @return the list of entry fields, html encoded 
     84     */ 
    3985     public function getEntries ($hidden=false) { 
    4086          $ret = ''; 
     
    59105     } 
    60106      
     107    /** 
     108     * __toString - magic method. -- DEPRECATED here 
     109      *              This method is only used to preserve compatibility with plugins  
     110      *                  relying on previous versions of adminPostsActionsContent behavior,  
     111      * 
     112     * @access public 
     113      * @return the list of hidden fields and entries (as hidden fields too), html encoded 
     114     */ 
    61115     public function __toString() { 
    62116          return join('',$this->hidden).$this->getEntries(true); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map