Source for file jFormsControlCheckboxes.class.php

Documentation is available at jFormsControlCheckboxes.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. /**
  13.  * Checkboxes control (contains several checkboxes)
  14.  * @package     jelix
  15.  * @subpackage  forms
  16.  */
  17. class jFormsControlCheckboxes extends jFormsControlDatasource {
  18.     public $type="checkboxes";
  19.  
  20.     function isContainer(){
  21.         return true;
  22.     }
  23.  
  24.     function check(){
  25.         $value $this->container->data[$this->ref];
  26.         if(is_array($value)){
  27.             if(count($value== && $this->required){
  28.                 return $this->container->errors[$this->refjForms::ERRDATA_REQUIRED;
  29.             }
  30.         }else{
  31.             if(trim($value== ''){
  32.                 if($this->required)
  33.                     return $this->container->errors[$this->refjForms::ERRDATA_REQUIRED;
  34.             }else{
  35.                 return $this->container->errors[$this->refjForms::ERRDATA_INVALID;
  36.             }
  37.         }
  38.         return null;
  39.     }
  40. }

Documentation generated on Wed, 24 Sep 2014 21:59:38 +0200 by phpDocumentor 1.4.3