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. @contributor
  7. @copyright   2006-2008 Laurent Jouanneau
  8. @link        http://www.jelix.org
  9. @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
  10. */
  11.  
  12. /**
  13.  * listbox
  14.  * @package     jelix
  15.  * @subpackage  forms
  16.  */
  17. class jFormsControlListbox extends jFormsControlDatasource {
  18.     public $type="listbox";
  19.     public $multiple = false;
  20.     public $size = 4;
  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 Thu, 22 Mar 2012 22:16:00 +0100 by phpDocumentor 1.4.3