From fae2d87433de0cc1d890f66e0811e4317d963aee Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 21 Aug 2009 21:35:34 +0000 Subject: [PATCH] Use Html::input() for login form This fixes some invalid HTML output in r54567, and also makes the output look more consistent and prettier. --- includes/templates/Userlogin.php | 117 ++++++++++++++++++------------- 1 file changed, 69 insertions(+), 48 deletions(-) diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index b853c8ab49..7a173002f9 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -12,8 +12,6 @@ if( !defined( 'MEDIAWIKI' ) ) die( -1 ); */ class UserloginTemplate extends QuickTemplate { function execute() { - global $wgHtml5; - if( $this->data['message'] ) { ?>
@@ -37,21 +35,29 @@ class UserloginTemplate extends QuickTemplate { - " /> + data['name'], 'text', array( + 'class' => 'loginText', + 'id' => 'wpName1', + 'tabindex' => '1', + 'size' => '20', + 'required', + 'autofocus' + ) ); ?> + - + 'loginPassword', + 'id' => 'wpPassword1', + 'tabindex' => '2', + 'size' => '20' + ) ); ?> + data['usedomain'] ) { @@ -74,21 +80,32 @@ if ( $wgHtml5 ) { - data['remember'] ) { ?>checked="checked" - /> + '4', + 'id' => 'wpRemember' + ) + ( $this->data['remember'] ? array( 'checked' ) : array() ) ); ?> + + - + -  data['useemail'] && $this->data['canreset']) { ?> - + 'wpLoginAttempt', + 'tabindex' => '5' + ) ); + if ( $this->data['useemail'] && $this->data['canreset'] ) { + echo ' '; + echo Html::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array( + 'id' => 'wpMailmypassword', + 'tabindex' => '6' + ) ); + } ?> + @@ -115,7 +132,7 @@ class UsercreateTemplate extends QuickTemplate { } function execute() { - global $wgHtml5, $wgMinimalPasswordLength; + global $wgMinimalPasswordLength; if( $this->data['message'] ) { ?> @@ -138,25 +155,26 @@ class UsercreateTemplate extends QuickTemplate { - /> + data['name'], 'text', array( + 'class' => 'loginText', + 'id' => 'wpName2', + 'tabindex' => '1', + 'size' => '20', + 'required' + ) ); ?> - 0 ) { - echo ' required=""'; -} -?> /> + 'loginPassword', + 'id' => 'wpPassword2', + 'tabindex' => '2', + 'size' => '20' + ) + ( $wgMinimalPasswordLength > 0 ? array( 'required' ) : array() ) ); ?> data['usedomain'] ) { @@ -178,23 +196,26 @@ if ( $wgHtml5 && $wgMinimalPasswordLength > 0 ) { - 0 ) { - echo ' required=""'; -} -?> /> + 'loginPassword', + 'id' => 'wpRetype', + 'tabindex' => '4', + 'size' => '20' + ) + ( $wgMinimalPasswordLength > 0 ? array( 'required' ) : array() ) ); ?> data['useemail'] ) { ?> - ' class='loginText' name="wpEmail" id="wpEmail" - tabindex="5" - value="text('email') ?>" size='20' /> + data['email'], 'email', array( + 'class' => 'loginText', + 'id' => 'wpEmail', + 'tabindex' => '5', + 'size' => '20' + ) ); ?>
data['emailrequired'] ) { $this->msgWiki('prefs-help-email-required'); -- 2.20.1