Merge "Remove a bunch of trailing spaces and unneeded newlines"
[lhc/web/wiklou.git] / includes / specials / SpecialWithoutinterwiki.php
index 3aa1b77..2988b04 100644 (file)
@@ -33,30 +33,30 @@ class WithoutInterwikiPage extends PageQueryPage {
        function __construct( $name = 'Withoutinterwiki' ) {
                parent::__construct( $name );
        }
-       
+
        function execute( $par ) {
-               global $wgRequest;
-               $this->prefix = Title::capitalize( $wgRequest->getVal( 'prefix', $par ), NS_MAIN );
+               $this->prefix = Title::capitalize(
+                       $this->getRequest()->getVal( 'prefix', $par ), NS_MAIN );
                parent::execute( $par );
        }
 
        function getPageHeader() {
-               global $wgScript, $wgMiserMode;
+               global $wgScript;
 
-               # Do not show useless input form if wiki is running in misermode
-               if( $wgMiserMode ) {
+               # Do not show useless input form if special page is cached
+               if( $this->isCached() ) {
                        return '';
                }
 
                $prefix = $this->prefix;
-               $t = SpecialPage::getTitleFor( $this->getName() );
+               $t = $this->getTitle();
 
-               return  Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
+               return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
                        Xml::openElement( 'fieldset' ) .
-                       Xml::element( 'legend', null, wfMsg( 'withoutinterwiki-legend' ) ) .
+                       Xml::element( 'legend', null, $this->msg( 'withoutinterwiki-legend' )->text() ) .
                        Html::hidden( 'title', $t->getPrefixedText() ) .
-                       Xml::inputLabel( wfMsg( 'allpagesprefix' ), 'prefix', 'wiprefix', 20, $prefix ) . ' ' .
-                       Xml::submitButton( wfMsg( 'withoutinterwiki-submit' ) ) .
+                       Xml::inputLabel( $this->msg( 'allpagesprefix' )->text(), 'prefix', 'wiprefix', 20, $prefix ) . ' ' .
+                       Xml::submitButton( $this->msg( 'withoutinterwiki-submit' )->text() ) .
                        Xml::closeElement( 'fieldset' ) .
                        Xml::closeElement( 'form' );
        }
@@ -64,7 +64,7 @@ class WithoutInterwikiPage extends PageQueryPage {
        function sortDescending() {
                return false;
        }
-       
+
        function getOrderFields() {
                return array( 'page_namespace', 'page_title' );
        }
@@ -80,17 +80,17 @@ class WithoutInterwikiPage extends PageQueryPage {
        function getQueryInfo() {
                $query = array (
                        'tables' => array ( 'page', 'langlinks' ),
-                       'fields' => array ( 'page_namespace AS namespace',
-                                       'page_title AS title',
-                                       'page_title AS value' ),
+                       'fields' => array ( 'namespace' => 'page_namespace',
+                                       'title' => 'page_title',
+                                       'value' => 'page_title' ),
                        'conds' => array ( 'll_title IS NULL',
-                                       'page_namespace' => NS_MAIN,
+                                       'page_namespace' => MWNamespace::getContentNamespaces(),
                                        'page_is_redirect' => 0 ),
                        'join_conds' => array ( 'langlinks' => array (
                                        'LEFT JOIN', 'll_from = page_id' ) )
                );
                if ( $this->prefix ) {
-                       $dbr = wfGetDb( DB_SLAVE );
+                       $dbr = wfGetDB( DB_SLAVE );
                        $query['conds'][] = 'page_title ' . $dbr->buildLike( $this->prefix, $dbr->anyString() );
                }
                return $query;