From: Florian Date: Fri, 26 Feb 2016 16:57:46 +0000 (+0100) Subject: Consistently use Html class for form generation X-Git-Tag: 1.31.0-rc.0~7818^2 X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=6e950320fdd8eb81f2a4a4e52015fa222260bfba Consistently use Html class for form generation Instead of Xml class. This was triggered by the comment of Krinkle on Ide77585fcf24f8ecd26dddac3610a134ba78dce9 and converting to one element generating class makes sense for readability. Change-Id: I2162444130dc09ad0c7e4329c93e7e90c534db40 --- diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 80ef4b180d..3528be0dc0 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -265,28 +265,32 @@ class SpecialEmailUser extends UnlistedSpecialPage { */ protected function userForm( $name ) { $this->getOutput()->addModules( 'mediawiki.userSuggest' ); - $string = Xml::openElement( - 'form', - [ 'method' => 'get', 'action' => wfScript(), 'id' => 'askusername' ] - ) . + $string = Html::openElement( + 'form', + [ 'method' => 'get', 'action' => wfScript(), 'id' => 'askusername' ] + ) . Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) . - Xml::openElement( 'fieldset' ) . + Html::openElement( 'fieldset' ) . Html::rawElement( 'legend', null, $this->msg( 'emailtarget' )->parse() ) . - Xml::inputLabel( + Html::label( $this->msg( 'emailusername' )->text(), + 'emailusertarget' + ) . ' ' . + Html::input( 'target', - 'emailusertarget', - 30, $name, + 'text', [ + 'id' => 'emailusertarget', 'class' => 'mw-autocomplete-user', // used by mediawiki.userSuggest - 'autofocus' => '', + 'autofocus' => true, + 'size' => 30, ] ) . ' ' . - Xml::submitButton( $this->msg( 'emailusernamesubmit' )->text() ) . - Xml::closeElement( 'fieldset' ) . - Xml::closeElement( 'form' ) . "\n"; + Html::submitButton( $this->msg( 'emailusernamesubmit' )->text(), [] ) . + Html::closeElement( 'fieldset' ) . + Html::closeElement( 'form' ) . "\n"; return $string; }