Source for file jFormsControlListbox.class.php

Documentation is available at jFormsControlListbox.class.php

  1. <?php
  2. /**
  3. @package     jelix
  4. @subpackage  forms
  5. @author      Laurent Jouanneau
  6. @copyright   2006-2008 Laurent Jouanneau
  7. @link        http://www.jelix.org
  8. @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
  9. */
  10.  
  11. /**
  12.  * listbox
  13.  * @package     jelix
  14.  * @subpackage  forms
  15.  */
  16. class jFormsControlListbox extends jFormsControlDatasource {
  17.     public $type="listbox";
  18.     public $multiple = false;
  19.     public $size = 4;
  20.     public $emptyItemLabel = null;
  21.  
  22.     function isContainer(){
  23.         return $this->multiple;
  24.     }
  25.  
  26.     function check(){
  27.         $value $this->container->data[$this->ref];
  28.         if(is_array($value)){
  29.             if(!$this->multiple){
  30.                 return $this->container->errors[$this->refjForms::ERRDATA_INVALID;
  31.             }
  32.             if(count($value== && $this->required){
  33.                 return $this->container->errors[$this->refjForms::ERRDATA_REQUIRED;
  34.             }
  35.         }else{
  36.             if(trim($value== '' && $this->required){
  37.                 return $this->container->errors[$this->refjForms::ERRDATA_REQUIRED;
  38.             }
  39.         }
  40.         return null;
  41.     }
  42. }

Documentation generated on Mon, 26 Oct 2015 21:54:12 +0100 by phpDocumentor 1.4.3