Esempio n. 1
0
 /**
  * initialize action
  *
  * @return void
  */
 protected function initializeAction()
 {
     $this->configuration = Configuration::create()->setTypoScript($this->settings['typoscript']);
     $this->formUtility = FormUtility::create($this->configuration);
     $this->validationBuilder = ValidationBuilder::create($this->configuration);
     $this->validationBuilder->setFormUtility($this->formUtility);
     $this->formBuilder = FormBuilder::create($this->configuration);
     $this->formBuilder->setValidationBuilder($this->validationBuilder);
     $this->formBuilder->setFormUtility($this->formUtility);
     $this->typoscript = $this->settings['typoscript'];
     // uploaded file storage
     $this->sessionUtility->initSession($this->configuration->getPrefix());
     // move the incoming "formPrefix" data to the $model argument
     // now we can validate the $model argument
     if ($this->request->hasArgument($this->configuration->getPrefix())) {
         $this->skipValidation = false;
         $argument = $this->request->getArgument($this->configuration->getPrefix());
         $this->request->setArgument('model', $argument);
     } else {
         // If there are more forms at a page we have to skip
         // the validation of not submitted forms
         $this->skipValidation = true;
         $this->request->setArgument('model', array());
     }
 }