コード例 #1
0
 /**
  * @see	Form:.save()
  */
 public function save()
 {
     parent::save();
     $entry = BashEntryEditor::create(BASHCore::getUser()->userID, $this->username, $this->serverID, $this->serverName, $this->text, TIME_NOW, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes);
     if (MODULE_USER_RANK and BASHCore::getUser()->userID > 0) {
         require_once WCF_DIR . 'lib/data/user/rank/UserRank.class.php';
         UserRank::updateActivityPoints(BASH_USER_ACTIVITY_POINTS);
     }
     if (WCF::getUser()->userID > 0) {
         HeaderUtil::redirect('index.php?page=BashEntry&entryID=' . $entry->entryID . SID_ARG_2ND_NOT_ENCODED);
     } else {
         // redirect to index
         WCF::getTPL()->assign(array('url' => 'index.php' . SID_ARG_1ST, 'message' => WCF::getLanguage()->get('bash.page.bashEntryAdd.guestRedirect'), 'wait' => 10));
         WCF::getTPL()->display('redirect');
         exit;
     }
     // call event
     $this->saved();
 }