From 6e681738dfab4022943644161265fb50f1aee01d Mon Sep 17 00:00:00 2001 From: tonythomas01 <01tonythomas@gmail.com> Date: Sun, 17 Apr 2016 14:36:07 +0530 Subject: [PATCH] Convert Special:WithoutInterwiki to HTMLForm TODO: Should be eventually converted to OOUI Bug: T117721 Change-Id: I56b6b78b53d2531ebdb9cd0f903a4ce475dbc56b --- includes/specials/SpecialWithoutinterwiki.php | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/includes/specials/SpecialWithoutinterwiki.php b/includes/specials/SpecialWithoutinterwiki.php index e2052b9fee..cca54b3589 100644 --- a/includes/specials/SpecialWithoutinterwiki.php +++ b/includes/specials/SpecialWithoutinterwiki.php @@ -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( 'inline', $formDescriptor, $this->getContext() ); + $htmlForm->setWrapperLegendMsg( 'withoutinterwiki-legend' ) + ->setSubmitTextMsg( 'withoutinterwiki-submit' ) + ->setMethod( 'get' ) + ->prepareForm() + ->displayForm( false ); } function sortDescending() { -- 2.20.1