From: Amir Sarabadani Date: Sun, 22 Jan 2017 03:44:53 +0000 (+0330) Subject: Standardize html form by using OOUI in Special:Categories X-Git-Tag: 1.31.0-rc.0~4254^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=870fa275dead3aaa1ab3bd71b5461f2c22fc17ba;p=lhc%2Fweb%2Fwiklou.git Standardize html form by using OOUI in Special:Categories Bug: T117728 Change-Id: I4811771210384a32407b7378c7428361e46da33e --- diff --git a/includes/specials/pagers/CategoryPager.php b/includes/specials/pagers/CategoryPager.php old mode 100644 new mode 100755 index 345577d6ea..eb369802de --- a/includes/specials/pagers/CategoryPager.php +++ b/includes/specials/pagers/CategoryPager.php @@ -92,21 +92,28 @@ class CategoryPager extends AlphabeticPager { } public function getStartForm( $from ) { - return Xml::tags( - 'form', - [ 'method' => 'get', 'action' => wfScript() ], - Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . - Xml::fieldset( - $this->msg( 'categories' )->text(), - Xml::inputLabel( - $this->msg( 'categoriesfrom' )->text(), - 'from', 'from', 20, $from, [ 'class' => 'mw-ui-input-inline' ] ) . - ' ' . - Html::submitButton( - $this->msg( 'categories-submit' )->text(), - [], [ 'mw-ui-progressive' ] - ) - ) - ); + $formDescriptor = [ + 'from' => [ + 'type' => 'title', + 'namespace' => NS_CATEGORY, + 'relative' => true, + 'label-message' => 'categoriesfrom', + 'name' => 'from', + 'id' => 'from', + 'size' => 20, + 'default' => $from, + ], + ]; + $hiddenFields = [ + 'title' => $this->getTitle()->getPrefixedText(), + ]; + + $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() ) + ->addHiddenFields( $hiddenFields ) + ->setSubmitTextMsg( 'categories-submit' ) + ->setWrapperLegendMsg( 'categories' ) + ->setMethod( 'get' ); + return $htmlForm->prepareForm()->getHTML( false ); } + }