$template->set( 'cansecurelogin', ( $wgSecureLogin === true ) );
$template->set( 'stickHTTPS', $this->mStickHTTPS );
+ if ( $this->mType === 'signup' && $user->isLoggedIn() ) {
+ $template->set( 'createAnother', true );
+ } else {
+ $template->set( 'createAnother', false );
+ }
+
if ( $this->mType == 'signup' ) {
if ( !self::getCreateaccountToken() ) {
self::setCreateaccountToken();
}
?>
<div id="userloginForm">
-<h2 class="createaccount-join"><?php $this->msg( 'createacct-join' ); ?></h2>
+<h2 class="createaccount-join">
+ <?php
+ $this->msg( $this->data['createAnother'] ?
+ '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 */ ?>
<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(
+ <?php
+ echo Html::input( 'wpName', $this->data['name'], 'text', array(
'class' => 'mw-input loginText',
'id' => 'wpName2',
'tabindex' => '1',
'size' => '20',
'required',
- 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text(),
- 'autofocus'
- ) ); ?>
+ 'placeholder' => $this->getMsg( $this->data['createAnother'] ?
+ 'createacct-another-username-ph' : 'userlogin-yourname-ph' )->text(),
+ ) );
+ ?>
</div>
<div>
<?php if ( $this->data['createemail'] ) { ?>
'id' => 'wpEmail',
'tabindex' => '6',
'size' => '20',
- 'placeholder' => $this->getMsg( 'createacct-email-ph' )->text()
+ 'placeholder' => $this->getMsg( $this->data['createAnother'] ?
+ 'createacct-another-email-ph' : 'createacct-email-ph' )->text()
) + ( $this->data['emailrequired'] ? array() : array( 'required' => '' ) ) );
?>
<?php } ?>
$tabIndex++;
?>
<div class="mw-submit">
- <input type='submit' class="mw-ui-button mw-ui-big mw-ui-block mw-ui-primary" name="wpCreateaccount" id="wpCreateaccount"
- tabindex="<?php echo $tabIndex++; ?>"
- value="<?php $this->msg( 'createacct-submit' ); ?>" />
+ <?php
+ echo Html::input( 'wpCreateaccount',
+ $this->getMsg( $this->data['createAnother'] ?
+ '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>
<?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 } ?>
'yourname' => 'Username:',
'userlogin-yourname' => 'Username',
'userlogin-yourname-ph' => 'Enter your username',
+'createacct-another-username-ph' => 'Enter the username',
'createacct-helpusername' => '', # do not translate or duplicate this message to other languages
'yourpassword' => 'Password:',
'userlogin-yourpassword' => 'Password',
'helplogin-url' => 'Help:Logging in',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Help with logging in]]',
'createacct-join' => 'Enter your information below.',
+'createacct-another-join' => 'Enter the new account\'s information below.',
'createacct-emailrequired' => 'Email address',
'createacct-emailoptional' => 'Email address (optional)',
'createacct-email-ph' => 'Enter your email address',
+'createacct-another-email-ph' => 'Enter email address',
'createaccountmail' => 'Use a temporary random password and send it to the email address specified below',
'createacct-realname' => 'Real name (optional)',
'createaccountreason' => 'Reason:',
'createacct-imgcaptcha-help' => '', # do not translate or duplicate this message to other languages
'createacct-imgcaptcha-ph' => 'Enter the text you see above',
'createacct-submit' => 'Create your account',
+'createacct-another-submit' => 'Create another account',
'createacct-benefit-heading' => '{{SITENAME}} is made by people like you.',
'createacct-benefit-icon1' => 'icon-edits', # do not translate or duplicate this message to other languages
'createacct-benefit-head1' => '{{NUMBEROFEDITS}}', # do not translate or duplicate this message to other languages
'userlogin-yourname-ph' => 'Placeholder text in login & create account form field.
See example: [[Special:UserLogin]] and [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
+'createacct-another-username-ph' => 'Placeholder text in create account form field when one user creates an account for another.',
'yourpassword' => 'In user preferences
{{Identical|Password}}',
'createacct-join' => 'Subheading of vertical-layout create account form encouraging user to join the wiki.
See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
-'createacct-emailrequired' => 'Label in vertical-layout create account form for email field when it is required.
+'createacct-another-join' => 'Subheading of create account form when one user creates an account for another.',
+'createacct-emailrequired' => 'Label in create account form for email field when it is required.
See also:
* {{msg-mw|Createacct-emailoptional}}
'createacct-email-ph' => 'Placeholder in vertical-layout create account form for email field.
See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
+'createacct-another-email-ph' => 'Placeholder in create account form for email field when one user creates an account for another.',
'createaccountmail' => 'The label for the checkbox for creating a new account and sending the new password to the specified e-mail address directly, as used on [[Special:UserLogin/signup]] when one user creates an account for another (if creating accounts by e-mail is allowed).
See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'createacct-submit' => 'Submit button on vertical-layout create account form.
See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
+'createacct-another-submit' => 'Submit button on create account form when one user creates an account for another.',
'createacct-benefit-heading' => 'In vertical-layout create account form, the heading for the section describing the benefits of creating an account.
See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'yourname',
'userlogin-yourname',
'userlogin-yourname-ph',
+ 'createacct-another-username-ph',
'createacct-helpusername',
'yourpassword',
'userlogin-yourpassword',
'helplogin-url',
'userlogin-helplink',
'createacct-join',
+ 'createacct-another-join',
'createacct-emailrequired',
'createacct-emailoptional',
'createacct-email-ph',
+ 'createacct-another-email-ph',
'createaccountmail',
'createacct-realname',
'createaccountreason',
'createacct-imgcaptcha-help',
'createacct-imgcaptcha-ph',
'createacct-submit',
+ 'createacct-another-submit',
'createacct-benefit-heading',
'createacct-benefit-icon1',
'createacct-benefit-head1',
var $emailLabel = $( 'label[for="wpEmail"]' ),
originalText = $emailLabel.text(),
requiredText = mw.message( 'createacct-emailrequired' ).text(),
- $createByMailCheckbox = $( '#wpCreateaccountMail' );
+ $createByMailCheckbox = $( '#wpCreateaccountMail' ),
+ $beforePwds = $( '.mw-row-password:first' ).prev(),
+ $pwds;
function updateForCheckbox() {
var checked = $createByMailCheckbox.prop( 'checked' );
if ( checked ) {
- $( '.mw-row-password' ).hide();
+ $pwds = $( '.mw-row-password' ).detach();
$emailLabel.text( requiredText );
} else {
- $( '.mw-row-password' ).show();
+ if ( $pwds ) {
+ $beforePwds.after( $pwds );
+ $pwds = null;
+ }
$emailLabel.text( originalText );
}
}