/** * @see Form::submit() */ public function submit() { // call submit event EventHandler::fireAction($this, 'submit'); $this->readFormParameters(); try { // attachment handling if ($this->showAttachments) { $this->attachmentListEditor->handleRequest(); } // poll handling if ($this->showPoll) { $this->pollEditor->readParams(); } // preview if ($this->preview) { require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php'; AttachmentBBCode::setAttachments($this->attachmentListEditor->getSortedAttachments()); WCF::getTPL()->assign('preview', PostEditor::createPreview($this->subject, $this->text, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes)); } // send message or save as draft if ($this->send) { $this->validate(); // no errors $this->save(); } } catch (UserInputException $e) { $this->errorField = $e->getField(); $this->errorType = $e->getType(); } }