public function execute() { parent::execute(); $entry = new NewsEntryEditor($this->entryID); if ($entry->entryID == 0) { throw new IllegalLinkException(); } if (!BASHCore::getUser()->getPermission('mod.bash.canDeleteNewsEntries') and BASHCore::getUser()->userID != $entry->authorID) { throw new PermissionDeniedException(); } NewsEntryEditor::remove($entry->entryID); HeaderUtil::redirect('index.php?page=Index' . SID_ARG_2ND_NOT_ENCODED); }
/** * @see Form::save() */ public function save() { parent::save(); $entry = NewsEntryEditor::create(WCF::getUser()->userID, $this->username, $this->subject, $this->text, TIME_NOW, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes); HeaderUtil::redirect('index.php?page=Index' . SID_ARG_2ND_NOT_ENCODED . '#entry' . $entry->entryID); // call event $this->saved(); }