Example #1
0
 /**
  * Check if the form needs to be displayed
  *
  * This is TRUE when nothing has been submitted,
  * when data has been submitted but the validation rules do not fit
  * or when the user returns from the confirmation screen.
  *
  * @return boolean TRUE when form needs to be shown
  */
 protected function showForm()
 {
     $show = FALSE;
     $submittedByPrefix = $this->requestHandler->getByMethod();
     if ($submittedByPrefix === NULL || !empty($submittedByPrefix) && !$this->validate->isValid() || !empty($submittedByPrefix) && $this->validate->isValid() && $this->requestHandler->getPost('confirmation-false', NULL) !== NULL) {
         $show = TRUE;
     }
     return $show;
 }
 /**
  * Add attachments when uploaded
  *
  * @return void
  */
 protected function addAttachmentsFromForm()
 {
     $formElements = $this->form->getElements();
     $values = $this->requestHandler->getByMethod();
     $this->addAttachmentsFromElements($formElements, $values);
 }