Followup r85227, update 4 special pages to properly use the context.
authorDaniel Friesen <dantman@users.mediawiki.org>
Sun, 3 Apr 2011 04:37:13 +0000 (04:37 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sun, 3 Apr 2011 04:37:13 +0000 (04:37 +0000)
includes/specials/SpecialActiveusers.php
includes/specials/SpecialAllmessages.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlankpage.php

index 2d0b582..c41d404 100644 (file)
@@ -187,4 +187,4 @@ class SpecialActiveUsers extends QueryPage {
 
                return $out;
        }
-}
\ No newline at end of file
+}
index 4270d83..4a55c87 100644 (file)
@@ -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() .
index 64c1db5..ec049ac 100644 (file)
@@ -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' ) ).
                                                '<tr>
                                                        <td>' .
                                                                $nsForm .
                                                        '</td>
                                                        <td class="mw-allpages-nav">' .
-                                                               $wgUser->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ),
+                                                               $this->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ),
                                                                        array(), array(), 'known' ) .
                                                        "</td>
                                                </tr>" .
@@ -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 .= "</td></tr></table>";
                }
 
-               $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 )
index aaa45a8..a187d3a 100644 (file)
@@ -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');
        }
 }