public function removeBoardModal()
 {
     wfProfileIn(__METHOD__);
     if (!$this->wg->User->isAllowed('forumadmin')) {
         $this->displayRestrictionError();
         wfProfileOut(__METHOD__);
         return false;
         // skip rendering
     }
     $boardId = $this->getVal('boardId', -1);
     $board = ForumBoard::newFromId($boardId);
     if (empty($board)) {
         WikiaLogger::instance()->error('Error reporter: failed to find board', ['jiraTicket' => 'SOC-590', 'boardId' => $boardId, 'method' => __METHOD__]);
         $this->response->setCode(404);
         return true;
     }
     $boardTitle = $board->getTitle()->getText();
     $forum = new Forum();
     $list = $forum->getBoardList();
     $this->destinationBoards = array(array('value' => '', 'content' => wfMessage('forum-board-destination-empty')->escaped()));
     foreach ($list as $value) {
         if ($boardId != $value['id']) {
             $this->destinationBoards[] = array('value' => $value['id'], 'content' => htmlspecialchars($value['name']));
         }
     }
     $this->setVal('title', wfMessage('forum-admin-delete-and-merge-board-modal-heading', $boardTitle)->plain());
     $this->setVal('submitLabel', wfMessage('forum-admin-delete-and-merge-button-label')->plain());
     $form = array('inputs' => array(array('type' => 'text', 'name' => 'boardTitle', 'isRequired' => true, 'label' => wfMessage('forum-admin-delete-board-title')->plain()), array('type' => 'custom', 'output' => wfMessage('forum-admin-merge-board-warning')->plain()), array('type' => 'select', 'name' => 'destinationBoardId', 'class' => 'destinationBoardId', 'isRequired' => true, 'label' => wfMessage('forum-admin-merge-board-destination', $boardTitle)->plain(), 'options' => $this->destinationBoards)), 'method' => 'post', 'action' => '');
     $this->setVal('html', $this->app->renderView('WikiaStyleGuideForm', 'index', array('form' => $form)));
     wfProfileOut(__METHOD__);
 }
예제 #2
0
 public function boardNewThread()
 {
     parent::newMessage();
     $this->isTopicPage = $this->getVal('isTopicPage', false);
     if ($this->isTopicPage) {
         $forum = new Forum();
         $list = $forum->getBoardList();
         $this->destinationBoards = array(array('value' => '', 'content' => wfMessage('forum-board-destination-empty')->escaped()));
         foreach ($list as $value) {
             $this->destinationBoards[] = array('value' => htmlspecialchars($value['name']), 'content' => htmlspecialchars($value['name']));
         }
     }
 }