コード例 #1
0
ファイル: number.php プロジェクト: shamusdougan/GDMCWebsite
 /**
  * 
  * Method to validate user inputs, if not: set field property isValid to false and set error message
  * @param string $inputType user input type (postValue, queryValue)
  */
 protected function validateUserInput($inputType)
 {
     $type = $this->type;
     $value = $this->{$inputType};
     //Empty value is valid
     if ($value == "") {
         return;
     }
     //if a value is set we test it is a valid number (which still may have dots and commas
     if (VisformsValidate::validate($type, array('value' => $value))) {
         return;
     } else {
         //invalid user inputs - set field->isValid to false
         $this->field->isValid = false;
         //set the Error Message
         VisformsMessage::getMessage($this->field->name, $type);
         return;
     }
 }
コード例 #2
0
ファイル: date.php プロジェクト: shamusdougan/GDMCWebsite
 /**
  * 
  * Constructor
  * 
  * @param string $name field name
  * @param array $args additional arguments
  */
 public function __construct($name, $args)
 {
     parent::__construct($name, $args);
     $this->text = 'COM_VISFORMS_FIELD_DATE_FORMAT';
     $this->args = $args;
 }
コード例 #3
0
ファイル: number.php プロジェクト: shamusdougan/GDMCWebsite
 /**
  * 
  * Constructor
  * 
  * @param string $name field name
  * @param array $args additional arguments
  */
 public function __construct($name, $args)
 {
     parent::__construct($name, $args);
     $this->text = 'COM_VISFORMS_FIELD_NOT_A_NUMBER';
 }
コード例 #4
0
ファイル: email.php プロジェクト: shamusdougan/GDMCWebsite
 /**
  * 
  * Constructor
  * 
  * @param string $name field name
  * @param array $args additional arguments
  */
 public function __construct($name, $args)
 {
     parent::__construct($name, $args);
     $this->text = 'COM_VISFORMS_FIELD_EMAIL_NOT_VALIDE';
 }
コード例 #5
0
ファイル: date.php プロジェクト: shamusdougan/GDMCWebsite
 /**
  * 
  * Method to validate user inputs, if not: set field property isValid to false and set error message
  * @param string $inputType user input type (postValue, queryValue)
  */
 protected function validateUserInput($inputType)
 {
     $type = $this->type;
     $value = $this->{$inputType};
     //Empty value is valid
     if ($value == "") {
         return true;
     }
     //if a value is set we test it has a valid date format
     if (VisformsValidate::validate($type, array('value' => $value, 'format' => $this->field->dateFormatPhp))) {
         return true;
     } else {
         //invalid date format - set field->isValid to false
         $this->field->isValid = false;
         //set the Error Message
         VisformsMessage::getMessage($this->field->name, $type, array('format' => $this->field->dateFormatPhp));
         //we cannot use the value!
         return false;
     }
 }