diff options
Diffstat (limited to 'includes/templates')
-rw-r--r-- | includes/templates/NoLocalSettings.php | 14 | ||||
-rw-r--r-- | includes/templates/Usercreate.php | 445 | ||||
-rw-r--r-- | includes/templates/Userlogin.php | 278 |
3 files changed, 385 insertions, 352 deletions
diff --git a/includes/templates/NoLocalSettings.php b/includes/templates/NoLocalSettings.php index 2483e58c..0006df40 100644 --- a/includes/templates/NoLocalSettings.php +++ b/includes/templates/NoLocalSettings.php @@ -22,7 +22,7 @@ */ if ( !defined( 'MEDIAWIKI' ) ) { - die( "NoLocalSettings.php is not a valid MediaWiki entry point\n" ); + die( "NoLocalSettings.php is not a valid MediaWiki entry point\n" ); } if ( !isset( $wgVersion ) ) { @@ -52,12 +52,12 @@ if ( !function_exists( 'session_name' ) ) { $installerStarted = ( $success && isset( $_SESSION['installData'] ) ); } ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns='http://www.w3.org/1999/xhtml' lang='en'> +<!DOCTYPE html> +<html lang="en" dir="ltr"> <head> + <meta charset="UTF-8" /> <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title> - <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> - <style type='text/css' media='screen'> + <style media='screen'> html, body { color: #000; background-color: #fff; @@ -79,9 +79,9 @@ if ( !function_exists( 'session_name' ) ) { <p> <?php if ( $installerStarted ) { - echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." ); + echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php."; } else { - echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." ); + echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first."; } ?> </p> diff --git a/includes/templates/Usercreate.php b/includes/templates/Usercreate.php index 541d9e40..fcd492cb 100644 --- a/includes/templates/Usercreate.php +++ b/includes/templates/Usercreate.php @@ -1,6 +1,6 @@ <?php /** - * Html form for account creation. + * Html form for account creation (since 1.22 with VForm appearance). * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,16 +21,12 @@ * @ingroup Templates */ -/** - * @defgroup Templates Templates - */ +class UsercreateTemplate extends BaseTemplate { -if( !defined( 'MEDIAWIKI' ) ) die( -1 ); - -/** - * @ingroup Templates - */ -class UsercreateTemplate extends QuickTemplate { + /** + * Extensions (AntiSpoof and TitleBlacklist) call this in response to + * UserCreateForm hook to add checkboxes to the create account form. + */ function addInputItem( $name, $value, $type, $msg, $helptext = false ) { $this->data['extraInput'][] = array( 'name' => $name, @@ -42,220 +38,253 @@ class UsercreateTemplate extends QuickTemplate { } function execute() { - if( $this->data['message'] ) { + global $wgCookieExpiration; + $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) ); ?> - <div class="<?php $this->text('messagetype') ?>box"> - <?php if ( $this->data['messagetype'] == 'error' ) { ?> - <strong><?php $this->msg( 'loginerror' )?></strong><br /> - <?php } ?> - <?php $this->html('message') ?> - </div> - <div class="visualClear"></div> -<?php } ?> +<div class="mw-ui-container"> + <?php if ( $this->haveData( 'languages' ) ) { ?> + <div id="languagelinks"> + <p><?php $this->html( 'languages' ); ?></p> + </div> + <?php } + if ( !wfMessage( 'signupstart' )->isDisabled() ) { ?> + <div id="signupstart"><?php $this->msgWiki( 'signupstart' ); ?></div> + <?php } ?> + <div id="userloginForm"> + <h2 class="createaccount-join"> + <?php $this->msg( $this->data['loggedin'] ? 'createacct-another-join' : 'createacct-join' ); ?> + </h2> + <form name="userlogin2" id="userlogin2" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>"> + <section class="mw-form-header"> + <?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?> + </section> + <?php if ( $this->data['message'] ) { ?> + <div class="<?php $this->text( 'messagetype' ); ?>box"> + <?php if ( $this->data['messagetype'] == 'error' ) { ?> + <strong><?php $this->msg( 'createacct-error' ); ?></strong> + <br /> + <?php } ?> + <?php $this->html( 'message' ); ?> + </div> + <?php } ?> -<div id="signupstart"><?php $this->msgWiki( 'signupstart' ); ?></div> -<div id="userlogin"> + <div> + <label for='wpName2'> + <?php $this->msg( 'userlogin-yourname' ); ?> -<form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>"> - <h2><?php $this->msg('createaccount') ?></h2> - <p id="userloginlink"><?php $this->html('link') ?></p> - <?php $this->html('header'); /* pre-table point for form plugins... */ ?> - <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?> - <table> - <tr> - <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td> - <td class="mw-input"> + <span class="mw-ui-flush-right"><?php echo $this->getMsg( 'createacct-helpusername' )->parse(); ?></span> + </label> <?php - echo Html::input( 'wpName', $this->data['name'], 'text', array( - 'class' => 'loginText', - 'id' => 'wpName2', - 'tabindex' => '1', - 'size' => '20', - 'required', - 'autofocus' - ) ); ?> - </td> - </tr> - <tr> - <td></td> - <td class="mw-input"> - <?php if( $this->data['createemail'] ) { - echo Xml::checkLabel( - wfMessage( 'createaccountmail' )->text(), - 'wpCreateaccountMail', - 'wpCreateaccountMail', - $this->data['createemailset'], - array( 'tabindex' => '2' ) - ); - } ?> - </td> - </tr> - <tr class="mw-row-password"> - <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td> - <td class="mw-input"> -<?php - echo Html::input( 'wpPassword', null, 'password', array( - 'class' => 'loginPassword', - 'id' => 'wpPassword2', - 'tabindex' => '3', - 'size' => '20' - ) + User::passwordChangeInputAttribs() ); ?> - </td> - </tr> - <?php if( $this->data['usedomain'] ) { - $doms = ""; - foreach( $this->data['domainnames'] as $dom ) { - $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>"; - } - ?> - <tr id="mw-user-domain-section"> - <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td> - <td class="mw-input"> - <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>" - tabindex="4"> - <?php echo $doms ?> - </select> - </td> - </tr> - <?php } ?> - <tr class="mw-row-password"> - <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td> - <td class="mw-input"> + echo Html::input( 'wpName', $this->data['name'], 'text', array( + 'class' => 'mw-input loginText', + 'id' => 'wpName2', + 'tabindex' => '1', + 'size' => '20', + 'required', + 'placeholder' => $this->getMsg( $this->data['loggedin'] ? + 'createacct-another-username-ph' : 'userlogin-yourname-ph' )->text(), + ) ); + ?> + </div> + + <div> + <?php if ( $this->data['createemail'] ) { ?> + <label class="mw-ui-checkbox-label"> + <input name="wpCreateaccountMail" type="checkbox" value="1" id="wpCreateaccountMail" tabindex="2" + <?php if ( $this->data['createemailset'] ) { + echo 'checked="checked"'; + } ?> + > + <?php $this->msg( 'createaccountmail' ); ?> + </label> + <?php } ?> + </div> + + <div class="mw-row-password"> + <label for='wpPassword2'><?php $this->msg( 'userlogin-yourpassword' ); ?></label> + <?php + echo Html::input( 'wpPassword', null, 'password', array( + 'class' => 'mw-input loginPassword', + 'id' => 'wpPassword2', + 'tabindex' => '3', + 'size' => '20', + 'required', + 'placeholder' => $this->getMsg( 'createacct-yourpassword-ph' )->text() + ) + User::passwordChangeInputAttribs() ); + ?> + </div> + + <?php + if ( $this->data['usedomain'] ) { + $doms = ""; + foreach ( $this->data['domainnames'] as $dom ) { + $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>"; + } + ?> + <div id="mw-user-domain-section"> + <label for="wpDomain"><?php $this->msg( 'yourdomainname' ); ?></label> + <div class="mw-input"> + <select name="wpDomain" value="<?php $this->text( 'domain' ); ?>" tabindex="4"> + <?php echo $doms ?> + </select> + </div> + </div> + <?php } ?> + + <div class="mw-row-password"> + <label for='wpRetype'><?php $this->msg( 'createacct-yourpasswordagain' ); ?></label> <?php - echo Html::input( 'wpRetype', null, 'password', array( - 'class' => 'loginPassword', - 'id' => 'wpRetype', - 'tabindex' => '5', - 'size' => '20' - ) + User::passwordChangeInputAttribs() ); ?> - </td> - </tr> - <tr> - <?php if( $this->data['useemail'] ) { ?> - <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td> - <td class="mw-input"> + echo Html::input( 'wpRetype', null, 'password', array( + 'class' => 'mw-input loginPassword', + 'id' => 'wpRetype', + 'tabindex' => '5', + 'size' => '20', + 'required', + 'placeholder' => $this->getMsg( 'createacct-yourpasswordagain-ph' )->text() + ) + User::passwordChangeInputAttribs() ); + ?> + </div> + + <div> + <?php if ( $this->data['useemail'] ) { ?> + <label for='wpEmail'> + <?php + $this->msg( $this->data['emailrequired'] ? + 'createacct-emailrequired' : + 'createacct-emailoptional' + ); + ?> + </label> <?php - echo Html::input( 'wpEmail', $this->data['email'], 'email', array( - 'class' => 'loginText', - 'id' => 'wpEmail', - 'tabindex' => '6', - 'size' => '20' - ) ); ?> + echo Html::input( 'wpEmail', $this->data['email'], 'email', array( + 'class' => 'mw-input loginText', + 'id' => 'wpEmail', + 'tabindex' => '6', + 'size' => '20', + 'required' => $this->data['emailrequired'], + 'placeholder' => $this->getMsg( $this->data['loggedin'] ? + 'createacct-another-email-ph' : 'createacct-email-ph' )->text() + ) ); + ?> + <?php } ?> + </div> + + <?php if ( $this->data['userealname'] ) { ?> + <div> + <label for='wpRealName'><?php $this->msg( 'createacct-realname' ); ?></label> + <input type='text' class='mw-input loginText' name="wpRealName" id="wpRealName" + tabindex="7" + value="<?php $this->text( 'realname' ); ?>" size='20' /> <div class="prefsectiontip"> - <?php // duplicated in Preferences.php profilePreferences() - if( $this->data['emailrequired'] ) { - $this->msgWiki('prefs-help-email-required'); - } else { - $this->msgWiki('prefs-help-email'); - } - if( $this->data['emailothers'] ) { - $this->msgWiki('prefs-help-email-others'); - } ?> + <?php $this->msgWiki( $this->data['loggedin'] ? 'createacct-another-realname-tip' : 'prefs-help-realname' ); ?> </div> - </td> - <?php } ?> - <?php if( $this->data['userealname'] ) { ?> - </tr> - <tr> - <td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td> - <td class="mw-input"> - <input type='text' class='loginText' name="wpRealName" id="wpRealName" - tabindex="7" - value="<?php $this->text('realname') ?>" size='20' /> - <div class="prefsectiontip"> - <?php $this->msgWiki('prefs-help-realname'); ?> - </div> - </td> + </div> <?php } ?> - <?php if( $this->data['usereason'] ) { ?> - </tr> - <tr> - <td class="mw-label"><label for='wpReason'><?php $this->msg('createaccountreason') ?></label></td> - <td class="mw-input"> - <input type='text' class='loginText' name="wpReason" id="wpReason" - tabindex="8" - value="<?php $this->text('reason') ?>" size='20' /> - </td> + + <?php if ( $this->data['usereason'] ) { ?> + <div> + <label for='wpReason'><?php $this->msg( 'createacct-reason' ); ?></label> + <?php echo Html::input( 'wpReason', $this->data['reason'], 'text', array( + 'class' => 'mw-input loginText', + 'id' => 'wpReason', + 'tabindex' => '8', + 'size' => '20', + 'placeholder' => $this->getMsg( 'createacct-reason-ph' )->text() + ) ); ?> + </div> <?php } ?> - </tr> - <?php if( $this->data['canremember'] ) { ?> - <tr> - <td></td> - <td class="mw-input"> - <?php - global $wgCookieExpiration; - $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) ); - echo Xml::checkLabel( - wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(), - 'wpRemember', - 'wpRemember', - $this->data['remember'], - array( 'tabindex' => '9' ) - ) - ?> - </td> - </tr> -<?php } - $tabIndex = 10; - if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) { - foreach ( $this->data['extraInput'] as $inputItem ) { ?> - <tr> <?php - if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) { - ?><td class="mw-label"><label for="<?php - echo htmlspecialchars( $inputItem['name'] ); ?>"><?php - $this->msgWiki( $inputItem['msg'] ) ?></label><?php - } else { - ?><td><?php - } - ?></td> - <td class="mw-input"> - <input type="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name="<?php - echo htmlspecialchars( $inputItem['name'] ); ?>" - tabindex="<?php echo $tabIndex++; ?>" - value="<?php - if ( $inputItem['type'] != 'checkbox' ) { - echo htmlspecialchars( $inputItem['value'] ); - } else { - echo '1'; - } - ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" - <?php - if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) ) - echo 'checked="checked"'; - ?> /> <?php - if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) { + $tabIndex = 9; + if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) { + foreach ( $this->data['extraInput'] as $inputItem ) { ?> + <div> + <?php + // If it's a checkbox, output the whole thing (assume it has a msg). + if ( $inputItem['type'] == 'checkbox' ) { + ?> + <label class="mw-ui-checkbox-label"> + <input + name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" + id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" + type="checkbox" value="1" + tabindex="<?php echo $tabIndex++; ?>" + <?php if ( !empty( $inputItem['value'] ) ) { + echo 'checked="checked"'; + } ?> + > + <?php $this->msg( $inputItem['msg'] ); ?> + </label> + <?php + } else { + // Not a checkbox. + // TODO (bug 31909) support other input types, e.g. select boxes. ?> - <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php - $this->msgHtml( $inputItem['msg'] ) ?></label><?php - } - if( $inputItem['helptext'] !== false ) { + <?php if ( !empty( $inputItem['msg'] ) ) { ?> + <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"> + <?php $this->msgWiki( $inputItem['msg'] ); ?> + </label> + <?php } ?> + <input + type="<?php echo htmlspecialchars( $inputItem['type'] ); ?>" + class="mw-input" + name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" + tabindex="<?php echo $tabIndex++; ?>" + value="<?php echo htmlspecialchars( $inputItem['value'] ); ?>" + id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" + /> + <?php } ?> + <?php if ( $inputItem['helptext'] !== false ) { ?> + <div class="prefsectiontip"> + <?php $this->msgWiki( $inputItem['helptext'] ); ?> + </div> + <?php } ?> + </div> + <?php + } + } + + // JS attempts to move the image CAPTCHA below this part of the form, + // so skip one index. + $tabIndex++; + ?> + <div class="mw-submit"> + <?php + echo Html::input( + 'wpCreateaccount', + $this->getMsg( $this->data['loggedin'] ? 'createacct-another-submit' : 'createacct-submit' ), + 'submit', + array( + 'class' => "mw-ui-button mw-ui-big mw-ui-block mw-ui-primary", + 'id' => 'wpCreateaccount', + 'tabindex' => $tabIndex++ + ) + ); ?> - <div class="prefsectiontip"> - <?php $this->msgWiki( $inputItem['helptext'] ); ?> + </div> + <?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> + <?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> + </form> + <?php if ( !wfMessage( 'signupend' )->isDisabled() ) { ?> + <div id="signupend"><?php $this->html( 'signupend' ); ?></div> + <?php } ?> + </div> + <div class="mw-createacct-benefits-container"> + <h2><?php $this->msg( 'createacct-benefit-heading' ); ?></h2> + <div class="mw-createacct-benefits-list"> + <?php + for ( $benefitIdx = 1; $benefitIdx <= $this->data['benefitCount']; $benefitIdx++ ) { + // Pass each benefit's head text (by default a number) as a parameter to the body's message for PLURAL handling. + $headUnescaped = $this->getMsg( "createacct-benefit-head$benefitIdx" )->text(); + ?> + <div class="mw-number-text <?php $this->msg( "createacct-benefit-icon$benefitIdx" ); ?>"> + <h3><?php $this->msg( "createacct-benefit-head$benefitIdx" ); ?></h3> + <p><?php echo $this->getMsg( "createacct-benefit-body$benefitIdx" )->params( $headUnescaped )->escaped(); ?></p> </div> - <?php } ?> - </td> - </tr> -<?php - } - } -?> - <tr> - <td></td> - <td class="mw-submit"> - <input type='submit' name="wpCreateaccount" id="wpCreateaccount" - tabindex="<?php echo $tabIndex++; ?>" - value="<?php $this->msg('createaccount') ?>" /> - </td> - </tr> - </table> -<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> -<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> -</form> + <?php } ?> + </div> + </div> </div> -<div id="signupend"><?php $this->html( 'signupend' ); ?></div> <?php } diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index 7bc0241a..5eb60948 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -1,6 +1,6 @@ <?php /** - * Html form for user login. + * Html form for user login (since 1.22 with VForm appearance). * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,156 +21,160 @@ * @ingroup Templates */ -/** - * @defgroup Templates Templates - */ +class UserloginTemplate extends BaseTemplate { -/** - * HTML template for Special:Userlogin form - * @ingroup Templates - */ -class UserloginTemplate extends QuickTemplate { function execute() { - if( $this->data['message'] ) { + global $wgCookieExpiration; + $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) ); ?> - <div class="<?php $this->text('messagetype') ?>box"> - <?php if ( $this->data['messagetype'] == 'error' ) { ?> - <strong><?php $this->msg( 'loginerror' )?></strong><br /> - <?php } ?> - <?php $this->html('message') ?> - </div> - <div class="visualClear"></div> -<?php } ?> +<div class="mw-ui-container"> + <?php if ( $this->haveData( 'languages' ) ) { ?> + <div id="languagelinks"> + <p><?php $this->html( 'languages' ); ?></p> + </div> + <?php } ?> + <div id="userloginForm"> + <form name="userlogin" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>"> + <?php if ( $this->data['loggedin'] ) { ?> + <div class="warningbox"> + <?php echo $this->getMsg( 'userlogin-loggedin' )->params( $this->data['loggedinuser'] )->parse(); ?> + </div> + <?php } ?> + <section class="mw-form-header"> + <?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?> + </section> -<div id="loginstart"><?php $this->msgWiki( 'loginstart' ); ?></div> -<div id="userloginForm"> -<form name="userlogin" method="post" action="<?php $this->text('action') ?>"> - <h2><?php $this->msg('login') ?></h2> - <p id="userloginlink"><?php $this->html('link') ?></p> - <?php $this->html('header'); /* pre-table point for form plugins... */ ?> - <div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div> - <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?> - <table> - <tr> - <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td> - <td class="mw-input"> - <?php - echo Html::input( 'wpName', $this->data['name'], 'text', array( - 'class' => 'loginText', - 'id' => 'wpName1', - 'tabindex' => '1', - 'size' => '20', - 'required' - # Can't do + array( 'autofocus' ) because + for arrays in PHP - # only works right for associative arrays! Thanks, PHP. - ) + ( $this->data['name'] ? array() : array( 'autofocus' => '' ) ) ); ?> + <?php if ( $this->data['message'] ) { ?> + <div class="<?php $this->text( 'messagetype' ); ?>box"> + <?php if ( $this->data['messagetype'] == 'error' ) { ?> + <strong><?php $this->msg( 'loginerror' ); ?></strong> + <br /> + <?php } ?> + <?php $this->html( 'message' ); ?> + </div> + <?php } ?> - </td> - </tr> - <tr> - <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td> - <td class="mw-input"> - <?php - echo Html::input( 'wpPassword', null, 'password', array( - 'class' => 'loginPassword', - 'id' => 'wpPassword1', - 'tabindex' => '2', - 'size' => '20' - ) + ( $this->data['name'] ? array( 'autofocus' ) : array() ) ); ?> + <div> + <label for='wpName1'> + <?php + $this->msg( 'userlogin-yourname' ); - </td> - </tr> - <?php if( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) { - $doms = ""; - foreach( $this->data['domainnames'] as $dom ) { - $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>"; - } - ?> - <tr id="mw-user-domain-section"> - <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td> - <td class="mw-input"> - <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>" - tabindex="3"> - <?php echo $doms ?> - </select> - </td> - </tr> - <?php } + if ( $this->data['secureLoginUrl'] ) { + echo Html::element( 'a', array( + 'href' => $this->data['secureLoginUrl'], + 'class' => 'mw-ui-flush-right mw-secure', + ), $this->getMsg( 'userlogin-signwithsecure' )->text() ); + } + ?> + </label> + <?php + $extraAttrs = array(); + echo Html::input( 'wpName', $this->data['name'], 'text', array( + 'class' => 'loginText', + 'id' => 'wpName1', + 'tabindex' => '1', + 'size' => '20', + // 'required' is blacklisted for now in Html.php due to browser issues. + // Keeping here in case that changes. + 'required' => true, + // Set focus to this field if it's blank. + 'autofocus' => !$this->data['name'], + 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text() + ) ); + ?> + </div> - if( $this->haveData( 'extrafields' ) ) { - echo $this->data['extrafields']; - } + <div> + <label for='wpPassword1'> + <?php + $this->msg( 'userlogin-yourpassword' ); - if( $this->data['canremember'] ) { ?> - <tr> - <td></td> - <td class="mw-input"> + if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) { + echo ' ' . Linker::link( + SpecialPage::getTitleFor( 'PasswordReset' ), + $this->getMsg( 'userlogin-resetpassword-link' )->parse(), + array( 'class' => 'mw-ui-flush-right' ) + ); + } + ?> + </label> <?php - global $wgCookieExpiration; - $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) ); - echo Xml::checkLabel( - wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(), - 'wpRemember', - 'wpRemember', - $this->data['remember'], - array( 'tabindex' => '8' ) - ) + echo Html::input( 'wpPassword', null, 'password', array( + 'class' => 'loginPassword', + 'id' => 'wpPassword1', + 'tabindex' => '2', + 'size' => '20', + // Set focus to this field if username is filled in. + 'autofocus' => (bool)$this->data['name'], + 'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text() + ) ); ?> - </td> - </tr> -<?php } ?> -<?php if( $this->data['cansecurelogin'] ) { ?> - <tr> - <td></td> - <td class="mw-input"> + </div> + <?php - echo Xml::checkLabel( - wfMessage( 'securelogin-stick-https' )->text(), - 'wpStickHTTPS', - 'wpStickHTTPS', - $this->data['stickHTTPS'], - array( 'tabindex' => '9' ) - ); - ?> - </td> - </tr> -<?php } ?> - <tr> - <td></td> - <td class="mw-submit"> - <?php - echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array( - 'id' => 'wpLoginAttempt', - 'tabindex' => '9' - ) ); - if ( $this->data['useemail'] && $this->data['canreset'] ) { - if( $this->data['resetlink'] === true ) { - echo ' '; - echo Linker::link( - SpecialPage::getTitleFor( 'PasswordReset' ), - wfMessage( 'userlogin-resetlink' ) - ); - } elseif( $this->data['resetlink'] === null ) { - echo ' '; - echo Html::input( - 'wpMailmypassword', - wfMessage( 'mailmypassword' )->text(), - 'submit', array( - 'id' => 'wpMailmypassword', - 'tabindex' => '10' - ) - ); + if ( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) { + $doms = ""; + foreach ( $this->data['domainnames'] as $dom ) { + $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>"; + } + ?> + <div id="mw-user-domain-section"> + <label for='wpDomain'><?php $this->msg( 'yourdomainname' ); ?></label> + <select name="wpDomain" value="<?php $this->text( 'domain' ); ?>" tabindex="3"> + <?php echo $doms; ?> + </select> + </div> + <?php } ?> + + <?php + if ( $this->haveData( 'extrafields' ) ) { + echo $this->data['extrafields']; } - } ?> + ?> - </td> - </tr> - </table> -<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> -<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> -</form> + <div> + <?php if ( $this->data['canremember'] ) { ?> + <label class="mw-ui-checkbox-label"> + <input name="wpRemember" type="checkbox" value="1" id="wpRemember" tabindex="4" + <?php if ( $this->data['remember'] ) { + echo 'checked="checked"'; + } ?> + > + <?php echo $this->getMsg( 'userlogin-remembermypassword' )->numParams( $expirationDays )->escaped(); ?> + </label> + <?php } ?> + </div> + + <div> + <?php + echo Html::input( 'wpLoginAttempt', $this->getMsg( 'login' )->text(), 'submit', array( + 'id' => 'wpLoginAttempt', + 'tabindex' => '6', + 'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-primary' + ) ); + ?> + </div> + + <div id="mw-userlogin-help"> + <?php echo $this->getMsg( 'userlogin-helplink' )->parse(); ?> + </div> + <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?> + <?php if ( $this->data['loggedin'] ) { ?> + <div id="mw-createaccount-another"> + <h3 id="mw-userloginlink"><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button"><?php $this->msg( 'userlogin-createanother' ); ?></a></h3> + </div> + <?php } else { ?> + <div id="mw-createaccount-cta"> + <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ); ?></a></h3> + </div> + <?php } ?> + <?php } ?> + <?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> + <?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> + <?php if ( $this->data['cansecurelogin'] ) {?><input type="hidden" name="wpForceHttps" value="<?php $this->text( 'stickhttps' ); ?>" /><?php } ?> + </form> + </div> </div> -<div id="loginend"><?php $this->html( 'loginend' ); ?></div> <?php } |