コード例 #1
0
 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);
 }
コード例 #2
0
 /**
  * @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();
 }