/**
  * @see OptionType::validate()
  */
 public function validate($optionData, $newValue)
 {
     $options = Board::getBoardSelect(array(), true);
     if (is_array($newValue)) {
         foreach ($newValue as $key => $value) {
             if (!isset($options[$value])) {
                 return false;
             }
         }
     }
     return true;
 }
 /**
  * @see OptionType::getFormElement()
  */
 public function getFormElement(&$optionData)
 {
     if (!isset($optionData['optionValue'])) {
         if (isset($optionData['defaultValue'])) {
             $optionData['optionValue'] = $optionData['defaultValue'];
         } else {
             $optionData['optionValue'] = false;
         }
     }
     // get options
     $options = Board::getBoardSelect(array(), true);
     WCF::getTPL()->assign(array('optionData' => $optionData, 'options' => $options));
     return WCF::getTPL()->fetch('optionTypeSelect');
 }
 /**
  * Gets a list of available parent boards.
  */
 protected function readBoardOptions()
 {
     $this->boardOptions = Board::getBoardSelect(array(), true, true);
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // boards
     $this->boardOptions = Board::getBoardSelect(array(), true, true);
     // language
     $this->languages = Language::getAvailableContentLanguages();
     foreach ($this->languages as $languageID => $language) {
         $this->languages[$languageID] = WCF::getLanguage()->get('wcf.global.language.' . $language['languageCode']);
     }
     StringUtil::sort($this->languages);
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     if (!count($_POST)) {
         // default values
         $this->username = WCF::getSession()->username;
         if (!$this->subscription && WCF::getUser()->enableSubscription) {
             $this->subscription = 1;
         }
     }
     $this->boardOptions = Board::getBoardSelect(array('canViewBoard'), true, true);
 }
Ejemplo n.º 6
0
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('permissions' => $this->board->getModeratorPermissions(), 'selfLink' => 'index.php?page=Board&boardID=' . $this->boardID . SID_ARG_2ND_NOT_ENCODED, 'daysPrune' => $this->daysPrune, 'markedPosts' => $this->markedPosts, 'markedThreads' => $this->markedThreads, 'board' => $this->board, 'boardID' => $this->boardID, 'prefix' => $this->prefix, 'boardQuickJumpOptions' => Board::getBoardSelect(), 'status' => $this->status, 'boardModerators' => $this->boardModerators, 'normalThreads' => $this->threadList != null ? $this->threadList->threads : null, 'topThreads' => $this->threadList != null ? $this->threadList->topThreads : null, 'newTopThreads' => $this->threadList != null ? $this->threadList->newTopThreads : 0, 'newNormalThreads' => $this->threadList != null ? $this->threadList->newThreads : 0, 'topThreadsStatus' => $this->topThreadsStatus, 'normalThreadsStatus' => $this->normalThreadsStatus, 'allowSpidersToIndexThisPage' => true, 'defaultSortField' => $this->defaultSortField, 'defaultSortOrder' => $this->defaultSortOrder, 'defaultDaysPrune' => $this->defaultDaysPrune, 'languageID' => $this->languageID, 'contentLanguages' => Language::getContentLanguages(), 'enableRating' => $this->enableRating, 'tags' => $this->tags, 'tagID' => $this->tagID, 'tag' => $this->tag));
     if (WCF::getSession()->spiderID) {
         if ($this->threadList != null && $this->threadList->maxLastPostTime) {
             @header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->threadList->maxLastPostTime) . ' GMT');
         }
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // boards
     $this->boardOptions = Board::getBoardSelect(array(), true, true);
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('permissions' => $this->board->getModeratorPermissions(), 'markedPosts' => $this->markedPosts, 'markedThreads' => $this->markedThreads, 'board' => $this->board, 'thread' => $this->thread, 'threadID' => $this->threadID, 'postID' => $this->postID, 'boardQuickJumpOptions' => Board::getBoardSelect(), 'similarThreads' => $this->similarThreads, 'showAvatar' => !WCF::getUser()->userID || WCF::getUser()->showAvatar, 'highlight' => $this->highlight, 'quotes' => $this->quotes, 'posts' => $this->postList->posts, 'polls' => $this->postList->polls, 'sidebarFactory' => $this->sidebarFactory, 'attachments' => $this->postList->attachments, 'allowSpidersToIndexThisPage' => true, 'enableRating' => $this->enableRating, 'tags' => $this->tags, 'sortOrder' => $this->sortOrder));
     if (WCF::getSession()->spiderID) {
         @header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->thread->lastPostTime) . ' GMT');
     }
 }
 /**
  * Shows post specific form elements in the global search form.
  */
 public function show($form = null)
 {
     // get unsearchable boards
     require_once WBB_DIR . 'lib/data/board/Board.class.php';
     $boards = WCF::getCache()->get('board', 'boards');
     $unsearchableBoardIDArray = array();
     foreach ($boards as $board) {
         if (!$board->searchable) {
             $unsearchableBoardIDArray[] = $board->boardID;
         }
     }
     // get existing values
     if ($form !== null && isset($form->searchData['additionalData']['post'])) {
         $this->boardIDs = $form->searchData['additionalData']['post']['boardIDs'];
         $this->findAttachments = $form->searchData['additionalData']['post']['findAttachments'];
         $this->findPolls = $form->searchData['additionalData']['post']['findPolls'];
     }
     WCF::getTPL()->assign(array('boardOptions' => Board::getBoardSelect(array('canViewBoard', 'canEnterBoard', 'canReadThread'), true, false, $unsearchableBoardIDArray), 'boardIDs' => $this->boardIDs, 'threadID' => $this->threadID, 'selectAllBoards' => count($this->boardIDs) == 0 || $this->boardIDs[0] == '*', 'findAttachments' => $this->findAttachments, 'findPolls' => $this->findPolls, 'findThreads' => $this->findThreads, 'findUserThreads' => $this->findUserThreads));
 }
Ejemplo n.º 10
0
 public function getPrefBoards()
 {
     if (!self::wbbExists()) {
         return array();
     }
     $ret = array();
     require_once WBB_DIR . '/lib/data/board/Board.class.php';
     $boardSelect = Board::getBoardSelect(array(), true, true);
     $sql = "SELECT boardID, title" . "\n  FROM wbb" . WBB_N . "_board" . "\n WHERE prefixes IS NULL" . "\n    OR prefixes = ''";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         if (isset($boardSelect[$row['boardID']])) {
             unset($boardSelect[$row['boardID']]);
         }
     }
     foreach ($boardSelect as $k => $v) {
         $ret[$k] = $v;
     }
     return $ret;
 }