コード例 #1
0
ファイル: edit.php プロジェクト: naujasdizainas/forkcms
 /**
  * Validate the form for step 4
  */
 private function validateFormForStep4()
 {
     // is the form submitted?
     if ($this->frm->isSubmitted()) {
         // cleanup the submitted fields, ignore fields that were added by hackers
         $this->frm->cleanupFields();
         // shorten fields
         $txtEmail = $this->frm->getField('email');
         $txtSendOnDate = $this->frm->getField('send_on_date');
         $txtSendOnTime = $this->frm->getField('send_on_time');
         // validation
         if ($txtEmail->isFilled(BL::err('FieldIsRequired'))) {
             $txtEmail->isEmail(BL::err('EmailIsInvalid'));
         }
         $txtSendOnDate->isValid(BL::err('DateIsInvalid'));
         $txtSendOnTime->isValid(BL::err('TimeIsInvalid'));
         // no errors?
         if ($this->frm->isCorrect()) {
             /*
             	the actual sending of a mailing happens in ajax/send_mailing.php
             	This, however, is the point where a preview is sent to a specific address.
             */
             BackendMailmotorCMHelper::sendPreviewMailing($this->id, $txtEmail->getValue());
             // build URL
             $url = BackendModel::createURLForAction('edit') . '&id=' . $this->id . '&step=4';
             // send the preview
             $this->redirect($url . '&report=preview-sent&var=' . $txtEmail->getValue());
         }
     }
 }