Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / specials / SpecialWithoutinterwiki.php
index e2052b9..a1e5156 100644 (file)
@@ -46,23 +46,23 @@ class WithoutInterwikiPage extends PageQueryPage {
                        return '';
                }
 
-               $prefix = $this->prefix;
-               $t = $this->getPageTitle();
+               $formDescriptor = [
+                       'prefix' => [
+                               'label-message' => 'allpagesprefix',
+                               'name' => 'prefix',
+                               'id' => 'wiprefix',
+                               'type' => 'text',
+                               'size' => 20,
+                               'default' => $this->prefix
+                       ]
+               ];
 
-               return Html::openElement( 'form', [ 'method' => 'get', 'action' => wfScript() ] ) . "\n" .
-                       Html::openElement( 'fieldset' ) . "\n" .
-                       Html::element( 'legend', null, $this->msg( 'withoutinterwiki-legend' )->text() ) . "\n" .
-                       Html::hidden( 'title', $t->getPrefixedText() ) . "\n" .
-                       Xml::inputLabel(
-                               $this->msg( 'allpagesprefix' )->text(),
-                               'prefix',
-                               'wiprefix',
-                               20,
-                               $prefix
-                       ) . "\n" .
-                       Xml::submitButton( $this->msg( 'withoutinterwiki-submit' )->text() ) . "\n" .
-                       Html::closeElement( 'fieldset' ) . "\n" .
-                       Html::closeElement( 'form' );
+               $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
+               $htmlForm->setWrapperLegend( '' )
+                       ->setSubmitTextMsg( 'withoutinterwiki-submit' )
+                       ->setMethod( 'get' )
+                       ->prepareForm()
+                       ->displayForm( false );
        }
 
        function sortDescending() {
@@ -97,7 +97,7 @@ class WithoutInterwikiPage extends PageQueryPage {
                        'join_conds' => [ 'langlinks' => [ 'LEFT JOIN', 'll_from = page_id' ] ]
                ];
                if ( $this->prefix ) {
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $query['conds'][] = 'page_title ' . $dbr->buildLike( $this->prefix, $dbr->anyString() );
                }