Exemple #1
0
 function initChecker($aValues = array(), $aSpecificValues = array())
 {
     $this->_aSpecificValues = $aSpecificValues;
     $oChecker = new BxDolFormChecker($this->_sCheckerHelper);
     $oChecker->setFormMethod($this->aFormAttrs['method'], $aSpecificValues);
     // init form with default values
     $aValuesDef = array();
     foreach ($this->aInputs as $k => $a) {
         if (!isset($a['value']) || !isset($a['db']['pass']) || isset(self::$TYPES_CHECKBOX[$a['type']])) {
             continue;
         }
         $aValuesDef[$k] = $a['value'];
     }
     $oChecker->fillWithValues($this->aInputs, $aValuesDef);
     // init form with provided values
     if ($aValues) {
         $oChecker->fillWithValues($this->aInputs, $aValues);
     }
     if ($this->isSubmitted()) {
         // init form with submitted data, overwrite prevously declared values
         $oChecker->enableFormCsrfChecking(isset($this->aParams['csrf']['disable']) && $this->aParams['csrf']['disable'] === true ? false : true);
         $this->_isValid = $oChecker->check($this->aInputs);
         if (!$this->_initCheckerNestedForms()) {
             $this->_isValid = false;
         }
     }
 }
Exemple #2
0
 function initChecker($aValues = array())
 {
     if ($this->isSubmitted()) {
         $oChecker = new BxDolFormChecker($this->_sCheckerHelper);
         $oChecker->setFormMethod($this->aFormAttrs['method']);
         $oChecker->enableFormCsrfChecking(isset($this->aParams['csrf']['disable']) && $this->aParams['csrf']['disable'] === true ? false : true);
         $this->_isValid = $oChecker->check($this->aInputs);
     } else {
         if ($aValues) {
             $oChecker = new BxDolFormChecker($this->_sCheckerHelper);
             $oChecker->setFormMethod($this->aFormAttrs['method']);
             $oChecker->fillWithValues($this->aInputs, $aValues);
         }
     }
     $oZ = new BxDolAlerts('form', 'init_checker', 0, 0, array('values' => $aValues, 'checker_object' => $oChecker, 'form_object' => $this, 'form_attrs' => &$this->aFormAttrs, 'table_attrs' => &$this->aTableAttrs, 'params' => &$this->aParams, 'inputs' => &$this->aInputs));
     $oZ->alert();
 }
Exemple #3
0
 function initChecker($aValues = array())
 {
     if ($this->isSubmitted()) {
         $oChecker = new BxDolFormChecker($this->_sCheckerHelper);
         $oChecker->setFormMethod($this->aFormAttrs['method']);
         $oChecker->enableFormCsrfChecking(isset($this->aParams['csrf']['disable']) && $this->aParams['csrf']['disable'] === true ? false : true);
         $this->_isValid = $oChecker->check($this->aInputs);
     } else {
         if ($aValues) {
             $oChecker = new BxDolFormChecker($this->_sCheckerHelper);
             $oChecker->setFormMethod($this->aFormAttrs['method']);
             $oChecker->fillWithValues($this->aInputs, $aValues);
         }
     }
 }