summaryrefslogtreecommitdiff
path: root/includes/templates/Usercreate.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/templates/Usercreate.php')
-rw-r--r--includes/templates/Usercreate.php80
1 files changed, 42 insertions, 38 deletions
diff --git a/includes/templates/Usercreate.php b/includes/templates/Usercreate.php
index fcd492cb..01da0bd7 100644
--- a/includes/templates/Usercreate.php
+++ b/includes/templates/Usercreate.php
@@ -1,4 +1,5 @@
<?php
+// @codingStandardsIgnoreFile
/**
* Html form for account creation (since 1.22 with VForm appearance).
*
@@ -22,7 +23,6 @@
*/
class UsercreateTemplate extends BaseTemplate {
-
/**
* Extensions (AntiSpoof and TitleBlacklist) call this in response to
* UserCreateForm hook to add checkboxes to the create account form.
@@ -51,24 +51,29 @@ class UsercreateTemplate extends BaseTemplate {
<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>
+ <!-- This element is used by the mediawiki.special.userlogin.signup.js module. -->
+ <div
+ id="mw-createacct-status-area"
+ <?php if ( $this->data['message'] ) { ?>
+ class="<?php echo $this->data['messagetype']; ?>box"
+ <?php } else { ?>
+ style="display: none;"
+ <?php } ?>
+ >
<?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>
- <div>
+ <div class="mw-ui-vform-field">
<label for='wpName2'>
<?php $this->msg( 'userlogin-yourname' ); ?>
@@ -76,7 +81,7 @@ class UsercreateTemplate extends BaseTemplate {
</label>
<?php
echo Html::input( 'wpName', $this->data['name'], 'text', array(
- 'class' => 'mw-input loginText',
+ 'class' => 'mw-ui-input loginText',
'id' => 'wpName2',
'tabindex' => '1',
'size' => '20',
@@ -87,24 +92,25 @@ class UsercreateTemplate extends BaseTemplate {
?>
</div>
- <div>
+ <div class="mw-ui-vform-field">
<?php if ( $this->data['createemail'] ) { ?>
- <label class="mw-ui-checkbox-label">
+ <div class="mw-ui-checkbox">
<input name="wpCreateaccountMail" type="checkbox" value="1" id="wpCreateaccountMail" tabindex="2"
<?php if ( $this->data['createemailset'] ) {
echo 'checked="checked"';
} ?>
- >
- <?php $this->msg( 'createaccountmail' ); ?>
- </label>
+ ><label for="wpCreateaccountMail">
+ <?php $this->msg( 'createaccountmail' ); ?>
+ </label>
+ </div>
<?php } ?>
</div>
- <div class="mw-row-password">
+ <div class="mw-ui-vform-field mw-row-password">
<label for='wpPassword2'><?php $this->msg( 'userlogin-yourpassword' ); ?></label>
<?php
echo Html::input( 'wpPassword', null, 'password', array(
- 'class' => 'mw-input loginPassword',
+ 'class' => 'mw-ui-input loginPassword',
'id' => 'wpPassword2',
'tabindex' => '3',
'size' => '20',
@@ -116,26 +122,25 @@ class UsercreateTemplate extends BaseTemplate {
<?php
if ( $this->data['usedomain'] ) {
- $doms = "";
+ $select = new XmlSelect( 'wpDomain', false, $this->data['domain'] );
+ $select->setAttribute( 'tabindex', 4 );
foreach ( $this->data['domainnames'] as $dom ) {
- $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
+ $select->addOption( $dom );
}
?>
- <div id="mw-user-domain-section">
+ <div class="mw-ui-vform-field" 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>
+ <?php echo $select->getHTML(); ?>
</div>
</div>
<?php } ?>
- <div class="mw-row-password">
+ <div class="mw-ui-vform-field mw-row-password">
<label for='wpRetype'><?php $this->msg( 'createacct-yourpasswordagain' ); ?></label>
<?php
echo Html::input( 'wpRetype', null, 'password', array(
- 'class' => 'mw-input loginPassword',
+ 'class' => 'mw-ui-input loginPassword',
'id' => 'wpRetype',
'tabindex' => '5',
'size' => '20',
@@ -145,7 +150,7 @@ class UsercreateTemplate extends BaseTemplate {
?>
</div>
- <div>
+ <div class="mw-ui-vform-field">
<?php if ( $this->data['useemail'] ) { ?>
<label for='wpEmail'>
<?php
@@ -157,7 +162,7 @@ class UsercreateTemplate extends BaseTemplate {
</label>
<?php
echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
- 'class' => 'mw-input loginText',
+ 'class' => 'mw-ui-input loginText',
'id' => 'wpEmail',
'tabindex' => '6',
'size' => '20',
@@ -170,9 +175,9 @@ class UsercreateTemplate extends BaseTemplate {
</div>
<?php if ( $this->data['userealname'] ) { ?>
- <div>
+ <div class="mw-ui-vform-field">
<label for='wpRealName'><?php $this->msg( 'createacct-realname' ); ?></label>
- <input type='text' class='mw-input loginText' name="wpRealName" id="wpRealName"
+ <input type='text' class='mw-ui-input loginText' name="wpRealName" id="wpRealName"
tabindex="7"
value="<?php $this->text( 'realname' ); ?>" size='20' />
<div class="prefsectiontip">
@@ -182,10 +187,10 @@ class UsercreateTemplate extends BaseTemplate {
<?php } ?>
<?php if ( $this->data['usereason'] ) { ?>
- <div>
+ <div class="mw-ui-vform-field">
<label for='wpReason'><?php $this->msg( 'createacct-reason' ); ?></label>
<?php echo Html::input( 'wpReason', $this->data['reason'], 'text', array(
- 'class' => 'mw-input loginText',
+ 'class' => 'mw-ui-input loginText',
'id' => 'wpReason',
'tabindex' => '8',
'size' => '20',
@@ -198,12 +203,12 @@ class UsercreateTemplate extends BaseTemplate {
$tabIndex = 9;
if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
foreach ( $this->data['extraInput'] as $inputItem ) { ?>
- <div>
+ <div class="mw-ui-vform-field">
<?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">
+ <div class="mw-ui-checkbox">
<input
name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
@@ -212,9 +217,8 @@ class UsercreateTemplate extends BaseTemplate {
<?php if ( !empty( $inputItem['value'] ) ) {
echo 'checked="checked"';
} ?>
- >
- <?php $this->msg( $inputItem['msg'] ); ?>
- </label>
+ ><label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"></label>
+ </div><?php $this->msgHtml( $inputItem['msg'] ); ?>
<?php
} else {
// Not a checkbox.
@@ -227,7 +231,7 @@ class UsercreateTemplate extends BaseTemplate {
<?php } ?>
<input
type="<?php echo htmlspecialchars( $inputItem['type'] ); ?>"
- class="mw-input"
+ class="mw-ui-input"
name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
tabindex="<?php echo $tabIndex++; ?>"
value="<?php echo htmlspecialchars( $inputItem['value'] ); ?>"
@@ -248,14 +252,14 @@ class UsercreateTemplate extends BaseTemplate {
// so skip one index.
$tabIndex++;
?>
- <div class="mw-submit">
+ <div class="mw-ui-vform-field 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",
+ 'class' => "mw-ui-button mw-ui-big mw-ui-block mw-ui-constructive",
'id' => 'wpCreateaccount',
'tabindex' => $tabIndex++
)