Пример #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());
     }
 }
Пример #2
0
 /**
  * The main method called by the post processor
  *
  * Configures the mail message
  *
  * @return string HTML message from this processor
  */
 public function process()
 {
     $this->formUtility = FormUtility::create($this->controllerContext->getConfiguration());
     $this->setSubject();
     $this->setFrom();
     $this->setTo();
     $this->setCc();
     $this->setReplyTo();
     $this->setPriority();
     $this->setOrganization();
     $this->setHtmlContent();
     $this->setPlainContent();
     $this->addAttachmentsFromSession();
     $this->send();
     return $this->render();
 }