From 97b6485f72018f1ac6250e9b0b7d961f2a51dad3 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Sun, 3 Apr 2011 04:37:13 +0000 Subject: [PATCH] Followup r85227, update 4 special pages to properly use the context. --- includes/specials/SpecialActiveusers.php | 2 +- includes/specials/SpecialAllmessages.php | 15 +++++----- includes/specials/SpecialAllpages.php | 35 ++++++++++++------------ includes/specials/SpecialBlankpage.php | 3 +- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 2d0b582885..c41d404eff 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -187,4 +187,4 @@ class SpecialActiveUsers extends QueryPage { return $out; } -} \ No newline at end of file +} diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index 4270d83af7..4a55c87800 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -49,32 +49,33 @@ class SpecialAllmessages extends SpecialPage { * @param $par Mixed: parameter passed to the page or null */ public function execute( $par ) { - global $wgOut, $wgRequest; + $request = $this->getRequest(); + $out = $this->getOutput(); $this->setHeaders(); global $wgUseDatabaseMessages; if( !$wgUseDatabaseMessages ) { - $wgOut->addWikiMsg( 'allmessagesnotsupportedDB' ); + $out->addWikiMsg( 'allmessagesnotsupportedDB' ); return; } else { $this->outputHeader( 'allmessagestext' ); } - $wgOut->addModuleStyles( 'mediawiki.special' ); + $out->addModuleStyles( 'mediawiki.special' ); - $this->filter = $wgRequest->getVal( 'filter', 'all' ); - $this->prefix = $wgRequest->getVal( 'prefix', '' ); + $this->filter = $request->getVal( 'filter', 'all' ); + $this->prefix = $request->getVal( 'prefix', '' ); $this->table = new AllmessagesTablePager( $this, array(), - wfGetLangObj( $wgRequest->getVal( 'lang', $par ) ) + wfGetLangObj( $request->getVal( 'lang', $par ) ) ); $this->langCode = $this->table->lang->getCode(); - $wgOut->addHTML( $this->buildForm() . + $out->addHTML( $this->buildForm() . $this->table->getNavigationBar() . $this->table->getLimitForm() . $this->table->getBody() . diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 64c1db50c1..ec049ac55a 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -58,25 +58,27 @@ class SpecialAllpages extends IncludableSpecialPage { * @param $par String: becomes "FOO" when called like Special:Allpages/FOO (default NULL) */ function execute( $par ) { - global $wgRequest, $wgOut, $wgContLang; + global $wgContLang; + $request = $this->getRequest(); + $out = $this->getOutput(); $this->setHeaders(); $this->outputHeader(); - $wgOut->allowClickjacking(); + $out->allowClickjacking(); # GET values - $from = $wgRequest->getVal( 'from', null ); - $to = $wgRequest->getVal( 'to', null ); - $namespace = $wgRequest->getInt( 'namespace' ); + $from = $request->getVal( 'from', null ); + $to = $request->getVal( 'to', null ); + $namespace = $request->getInt( 'namespace' ); $namespaces = $wgContLang->getNamespaces(); - $wgOut->setPagetitle( + $out->setPagetitle( ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) : wfMsg( 'allarticles' ) ); - $wgOut->addModuleStyles( 'mediawiki.special' ); + $out->addModuleStyles( 'mediawiki.special' ); if( isset($par) ) { $this->showChunk( $namespace, $par, $to ); @@ -142,7 +144,7 @@ class SpecialAllpages extends IncludableSpecialPage { * @param $to String: list all pages to this name */ function showToplevel( $namespace = NS_MAIN, $from = '', $to = '' ) { - global $wgOut; + $output = $this->getOutput(); # TODO: Either make this *much* faster or cache the title index points # in the querycache table. @@ -221,7 +223,7 @@ class SpecialAllpages extends IncludableSpecialPage { if( !empty($lines) ) { $this->showChunk( $namespace, $from, $to ); } else { - $wgOut->addHTML( $this->namespaceForm( $namespace, $from, $to ) ); + $output->addHTML( $this->namespaceForm( $namespace, $from, $to ) ); } return; } @@ -241,14 +243,13 @@ class SpecialAllpages extends IncludableSpecialPage { $out2 = ''; } else { if( isset($from) || isset($to) ) { - global $wgUser; $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ). ' ' . $nsForm . ' ' . - $wgUser->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ), + $this->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ), array(), array(), 'known' ) . " " . @@ -257,7 +258,7 @@ class SpecialAllpages extends IncludableSpecialPage { $out2 = $nsForm; } } - $wgOut->addHTML( $out2 . $out ); + $output->addHTML( $out2 . $out ); } /** @@ -292,9 +293,9 @@ class SpecialAllpages extends IncludableSpecialPage { * @param $to String: list all pages to this name (default FALSE) */ function showChunk( $namespace = NS_MAIN, $from = false, $to = false ) { - global $wgOut, $wgUser, $wgContLang, $wgLang; - - $sk = $wgUser->getSkin(); + global $wgContLang, $wgLang; + $output = $this->getOutput(); + $sk = $this->getSkin(); $fromList = $this->getNamespaceKeyAndText($namespace, $from); $toList = $this->getNamespaceKeyAndText( $namespace, $to ); @@ -447,14 +448,14 @@ class SpecialAllpages extends IncludableSpecialPage { $out2 .= ""; } - $wgOut->addHTML( $out2 . $out ); + $output->addHTML( $out2 . $out ); $links = array(); if ( isset( $prevLink ) ) $links[] = $prevLink; if ( isset( $nextLink ) ) $links[] = $nextLink; if ( count( $links ) ) { - $wgOut->addHTML( + $output->addHTML( Html::element( 'hr' ) . Html::rawElement( 'div', array( 'class' => 'mw-allpages-nav' ), $wgLang->pipeList( $links ) diff --git a/includes/specials/SpecialBlankpage.php b/includes/specials/SpecialBlankpage.php index aaa45a80f2..a187d3a311 100644 --- a/includes/specials/SpecialBlankpage.php +++ b/includes/specials/SpecialBlankpage.php @@ -32,8 +32,7 @@ class SpecialBlankpage extends UnlistedSpecialPage { parent::__construct( 'Blankpage' ); } public function execute( $par ) { - global $wgOut; $this->setHeaders(); - $wgOut->addWikiMsg('intentionallyblankpage'); + $this->getOutput()>addWikiMsg('intentionallyblankpage'); } } -- 2.20.1