/**
  * @param SpecialPage $page The special page to execute
  * @param string $subPage The subpage parameter to call the page with
  * @param WebRequest|null $request Web request that may contain URL parameters, etc
  * @param Language|string|null $language The language which should be used in the context
  * @param User|null $user The user which should be used in the context of this special page
  *
  * @throws Exception
  * @return array( string, WebResponse ) A two-elements array containing the HTML output
  * generated by the special page as well as the response object.
  */
 public function executeSpecialPage(SpecialPage $page, $subPage = '', WebRequest $request = null, $language = null, User $user = null)
 {
     $context = $this->newContext($request, $language, $user);
     $output = new OutputPage($context);
     $context->setOutput($output);
     $page->setContext($context);
     $output->setTitle($page->getPageTitle());
     $html = $this->getHTMLFromSpecialPage($page, $subPage);
     $response = $context->getRequest()->response();
     if ($response instanceof FauxResponse) {
         $code = $response->getStatusCode();
         if ($code > 0) {
             $response->header('Status: ' . $code . ' ' . HttpStatus::getMessage($code));
         }
     }
     return [$html, $response];
 }
 /**
  * @return string Formatted table cell contents
  */
 protected function formatActionValue($row)
 {
     $target = SpecialGlobalRenameQueue::PAGE_PROCESS_REQUEST . '/' . $row->rq_id;
     if ($this->showOpenRequests()) {
         $label = 'globalrenamequeue-action-address';
     } else {
         $target .= '/' . SpecialGlobalRenameQueue::ACTION_VIEW;
         $label = 'globalrenamequeue-action-view';
     }
     return Html::element('a', array('href' => $this->mOwner->getPageTitle($target)->getFullURL(), 'class' => 'mw-ui-progressive'), $this->msg($label)->text());
 }
Esempio n. 3
0
 /**
  * Get the Title being used for this instance.
  * SpecialPage extends ContextSource as of 1.18.
  *
  * @since 0.1
  *
  * @param boolean $subPage
  *
  * @return Title
  */
 public function getPageTitle($subPage = false)
 {
     return version_compare($GLOBALS['wgVersion'], '1.18', '>') ? parent::getPageTitle() : $GLOBALS['wgTitle'];
 }