Merge "add Interwiki::selectFields"
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 11 May 2012 22:33:58 +0000 (22:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 11 May 2012 22:33:58 +0000 (22:33 +0000)
includes/Namespace.php
includes/api/ApiQuerySiteinfo.php
includes/logging/LogFormatter.php
includes/parser/Parser.php
includes/specials/SpecialLockdb.php
includes/specials/SpecialRandompage.php
includes/specials/SpecialUserlogout.php
includes/specials/SpecialWantedfiles.php
resources/Resources.php
tests/phpunit/includes/MWNamespaceTest.php

index bdccca1..9ec6948 100644 (file)
@@ -361,7 +361,7 @@ class MWNamespace {
         * @param $index int Index to check
         * @return bool
         */
-       public static function isNonincludableNamespace( $index ) {
+       public static function isNonincludable( $index ) {
                global $wgNonincludableNamespaces;
                return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces );
        }
index fc5d7bb..e7102e0 100644 (file)
@@ -216,7 +216,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                $data[$ns]['content'] = '';
                        }
 
-                       if ( MWNamespace::isNonincludableNamespace( $ns ) ) {
+                       if ( MWNamespace::isNonincludable( $ns ) ) {
                                $data[$ns]['nonincludable'] = '';
                        }
                }
index 6d8ece1..1ba6a3b 100644 (file)
@@ -727,4 +727,12 @@ class NewUsersLogFormatter extends LogFormatter {
                }
                return parent::getComment();
        }
+
+       public function getPreloadTitles() {
+               if ( $this->entry->getSubtype() === 'create2' ) {
+                       //add the user talk to LinkBatch for the userLink
+                       return array( Title::makeTitle( NS_USER_TALK, $this->entry->getTarget()->getText() ) );
+               }
+               return array();
+       }
 }
index ba7ff60..fa98dbf 100644 (file)
@@ -3309,7 +3309,7 @@ class Parser {
                                                $isHTML = true;
                                                $this->disableCache();
                                        }
-                               } elseif ( MWNamespace::isNonincludableNamespace( $title->getNamespace() ) ) {
+                               } elseif ( MWNamespace::isNonincludable( $title->getNamespace() ) ) {
                                        $found = false; # access denied
                                        wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() );
                                } else {
index c145351..d71ac6e 100644 (file)
@@ -87,13 +87,11 @@ class SpecialLockdb extends FormSpecialPage {
                }
                fwrite( $fp, $data['Reason'] );
                $timestamp = wfTimestampNow();
-               fwrite( $fp, "\n<p>" . wfMsgExt(
-                       'lockedbyandtime',
-                       array( 'content', 'parsemag' ),
+               fwrite( $fp, "\n<p>" . $this->msg( 'lockedbyandtime',
                        $this->getUser()->getName(),
-                       $wgContLang->date( $timestamp ),
-                       $wgContLang->time( $timestamp )
-               ) . "</p>\n" );
+                       $wgContLang->date( $timestamp, false, false ),
+                       $wgContLang->time( $timestamp, false, false )
+               )->inContentLanguage()->text() . "</p>\n" );
                fclose( $fp );
 
                return Status::newGood();
index 0b6239b..307088e 100644 (file)
@@ -85,7 +85,7 @@ class RandomPage extends SpecialPage {
                $nsNames = array();
                foreach( $this->namespaces as $n ) {
                        if( $n === NS_MAIN ) {
-                               $nsNames[] = wfMsgNoTrans( 'blanknamespace' );
+                               $nsNames[] = $this->msg( 'blanknamespace' )->plain();
                        } else {
                                $nsNames[] = $wgContLang->getNsText( $n );
                        }
index d747448..ab2bf0a 100644 (file)
@@ -39,7 +39,7 @@ class SpecialUserlogout extends UnlistedSpecialPage {
                 */
                if ( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '&amp;' ) !== false ) {
                        wfDebug( "Special:Userlogout request {$_SERVER['REQUEST_URI']} looks suspicious, denying.\n" );
-                       throw new HttpError( 400, wfMessage( 'suspicious-userlogout' ), wfMessage( 'loginerror' ) );
+                       throw new HttpError( 400, $this->msg( 'suspicious-userlogout' ), $this->msg( 'loginerror' ) );
                }
 
                $this->setHeaders();
index 25b93b1..2475189 100644 (file)
@@ -39,7 +39,7 @@ class WantedFilesPage extends WantedQueryPage {
                # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what
                # category would be used on main namespace pages, for those tricky wikipedia
                # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}.
-               $catMessage = wfMessage( 'broken-file-category' )
+               $catMessage = $this->msg( 'broken-file-category' )
                        ->title( Title::newFromText( "Wanted Files", NS_MAIN ) )
                        ->inContentLanguage();
                
index f186183..34b9be6 100644 (file)
@@ -76,7 +76,7 @@ return array(
                        'common/commonContent.css' => array( 'media' => 'screen' ),
                        'common/commonInterface.css' => array( 'media' => 'screen' ),
                        'vector/screen.css' => array( 'media' => 'screen' ),
-                       'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 900px)' ),
+                       'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 982px)' ),
                ),
                'scripts' => 'vector/vector.js',
                'remoteBasePath' => $GLOBALS['wgStylePath'],
index d459022..da36ffd 100644 (file)
@@ -546,6 +546,15 @@ class MWNamespaceTest extends MediaWikiTestCase {
 
        }
 
+       public function testIsNonincludable() {
+               global $wgNonincludableNamespaces;
+               $wgNonincludableNamespaces = array( NS_USER );
+
+               $this->assertTrue( MWNamespace::isNonincludable( NS_USER ) );
+
+               $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) );
+       }
+
        ####### HELPERS ###########################################################
        function __call( $method, $args ) {
                // Call the real method if it exists