* The "VForm" templates replace existing templates.
* Remove useNew switch logic and $wgUseVForm{UserLogin,CreateAccount}.
* The CSS and JS files for forms lose the .vform qualifier, except for
the CSS for styling vform elements.
* Merge tiny mediawiki.special.userLogin.signup.js into createAccount.js.
* Remove replaced and obsolete messages (see
https://www.mediawiki.org/wiki/Account_creation_user_experience/Strings
for details), and remove mention of "new" forms and useNew from
MessagesQqq.php.
Bug: 46333
Change-Id: I50f25583c3aa9a4a263fb40f50256f92c18ddb4d
=== Configuration changes in 1.22 ===
* $wgRedirectScript was removed. It was unused.
* Removed $wgLocalMessageCacheSerialized, it is now always true.
-* When $wgUseVFormUserLogin is true, the redesign of Special:UserLogin is
- activated; when $wgUseVFormCreateAccount is true, the redesign of
- Special:UserLogin/signup is activated.
* $wgVectorUseIconWatch is now enabled by default.
* $wgCascadingRestrictionLevels was added.
* ftps, ssh, sftp, xmpp, sip, sips, tel, sms, bitcoin, magnet, urn, and geo
* New 'mediawiki.ui' CSS module providing mw-ui-* styles for buttons and a
compact vertical form layout.
* New versions of login (Special:UserLogin) and create account
- (Special:UserLogin/signup) forms. They are opt-in for now, controlled by
- the $wgUseVFormUserLogin and $wgUseVFormCreateAccount settings or a 'useNew'
- URL parameter trigger.
+ (Special:UserLogin/signup) forms using the "vform" compact vertical form layout.
+ These forms use new messages that assume a "Help logging in" link, see
+ https://www.mediawiki.org/wiki/Manual:Page_customizations;
+ https://www.mediawiki.org/wiki/Account_creation_user_experience/Strings lists the
+ message key changes.
* (bug 23343) Implemented ability to apply IP blocks to the contents of X-Forwarded-For headers
by adding a new configuration variable $wgApplyIpBlocksToXff (disabled by default).
* The new hook 'APIGetPossibleErrors' to modify the list of possible errors was
# includes/templates
'UserloginTemplate' => 'includes/templates/Userlogin.php',
- 'UserloginTemplateVForm' => 'includes/templates/UserloginVForm.php',
'UsercreateTemplate' => 'includes/templates/Usercreate.php',
- 'UsercreateTemplateVForm' => 'includes/templates/UsercreateVForm.php',
# includes/upload
'UploadBase' => 'includes/upload/UploadBase.php',
*/
$wgVectorUseIconWatch = true;
-/**
- * Use compact vertical form ("VForm") design for Special:Userlogin. This can
- * be overridden by a useNew bool in the query string. For instance, if it is
- * globally false, you can try it with useNew=1.
- *
- * @since 1.22
- */
-$wgUseVFormUserLogin = false;
-
-/**
- * Use compact vertical form ("VForm") design for account creation
- * (Special:Userlogin?type=signup).
- *
- * @since 1.22
- */
-$wgUseVFormCreateAccount = false;
-
/**
* Display user edit counts in various prominent places.
*/
var $mAbortLoginErrorMsg = 'login-abort-generic';
private $mLoaded = false;
private $mSecureLoginUrl;
- // TODO Remove old forms and mShowVForm gating after all WMF wikis have
- // adapted messages and help links to new versions.
- private $mShowVForm;
/**
* @ var WebRequest
}
function getDescription() {
- if ( !$this->getUser()->isAllowed( 'createaccount' ) ) {
- return $this->msg( 'userloginnocreate' )->text();
- }
- if ( $this->mShowVForm ) {
- if ( $this->mType === 'signup' ) {
- return $this->msg( 'createaccount' )->text();
- } else {
- return $this->msg( 'login' )->text();
- }
+ if ( $this->mType === 'signup' ) {
+ return $this->msg( 'createaccount' )->text();
} else {
- return $this->msg( 'userlogin' )->text();
+ return $this->msg( 'login' )->text();
}
}
if ( $subPage == 'signup' ) {
$this->mType = 'signup';
}
- $this->mShowVForm = $this->shouldShowVForm();
-
$this->setHeaders();
// If logging in and not on HTTPS, either redirect to it or offer a link.
}
}
- /**
- * Whether to show new vertically laid out login form.
- * ?useNew=1 forces new style, ?useNew=0 forces old style,
- * otherwise consult $wgUseVFormUserLogin.
- * @return Boolean
- */
- private function shouldShowVForm() {
- global $wgUseVFormCreateAccount, $wgUseVFormUserLogin;
-
- if ( $this->mType == 'signup' ) {
- return $this->mRequest->getBool( 'useNew', $wgUseVFormCreateAccount );
- } else {
- return $this->mRequest->getBool( 'useNew', $wgUseVFormUserLogin );
- }
- }
-
/**
* @private
*/
}
if ( $this->mType == 'signup' ) {
- $out->addModules( 'mediawiki.special.userlogin.signup' );
- if ( $this->mShowVForm ) {
- $template = new UsercreateTemplateVForm();
- $out->addModuleStyles( array(
- 'mediawiki.ui',
- 'mediawiki.special.createaccount.vform'
- ) );
- // XXX hack pending RL or JS parse() support for complex content messages
- // https://bugzilla.wikimedia.org/show_bug.cgi?id=25349
- $out->addJsConfigVars( 'wgCreateacctImgcaptchaHelp',
- $this->msg( 'createacct-imgcaptcha-help' )->parse() );
- $out->addModules( 'mediawiki.special.createaccount.vform.js' );
- // Must match number of benefits defined in messages
- $template->set( 'benefitCount', 3 );
- } else {
- $template = new UsercreateTemplate();
- }
+ $template = new UsercreateTemplate();
+
+ $out->addModuleStyles( array(
+ 'mediawiki.ui',
+ 'mediawiki.special.createaccount'
+ ) );
+ // XXX hack pending RL or JS parse() support for complex content messages
+ // https://bugzilla.wikimedia.org/show_bug.cgi?id=25349
+ $out->addJsConfigVars( 'wgCreateacctImgcaptchaHelp',
+ $this->msg( 'createacct-imgcaptcha-help' )->parse() );
+ $out->addModules( array(
+ 'mediawiki.special.createaccount.js'
+ ) );
+ // Must match number of benefits defined in messages
+ $template->set( 'benefitCount', 3 );
+
$q = 'action=submitlogin&type=signup';
$linkq = 'type=login';
- $linkmsg = 'gotaccount';
} else {
- if ( $this->mShowVForm ) {
- $template = new UserloginTemplateVForm();
- $out->addModuleStyles( array(
- 'mediawiki.ui',
- 'mediawiki.special.userlogin.vform'
- ) );
- } else {
- $template = new UserloginTemplate();
- }
+ $template = new UserloginTemplate();
+
+ $out->addModuleStyles( array(
+ 'mediawiki.ui',
+ 'mediawiki.special.userlogin'
+ ) );
+
$q = 'action=submitlogin&type=login';
$linkq = 'type=signup';
- $linkmsg = 'nologin';
}
if ( $this->mReturnTo !== '' ) {
if ( $wgLoginLanguageSelector && $this->mLanguage ) {
$linkq .= '&uselang=' . $this->mLanguage;
}
- if ( !$this->mShowVForm ) {
- $link = Html::element( 'a', array( 'href' => $titleObj->getLocalURL( $linkq ) ),
- $this->msg( $linkmsg . 'link' )->text() ); # Calling either 'gotaccountlink' or 'nologinlink'
-
- $template->set( 'link', $this->msg( $linkmsg )->rawParams( $link )->parse() );
-
- } else {
- // Supply URL, login template creates the button.
- // (The template 'link' key, passed above, is obsolete in the VForm design.)
- $template->set( 'createOrLoginHref', $titleObj->getLocalURL( $linkq ) );
- }
+ // Supply URL, login template creates the button.
+ $template->set( 'createOrLoginHref', $titleObj->getLocalURL( $linkq ) );
} else {
$template->set( 'link', '' );
}
<?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
* @ingroup Templates
*/
-/**
- * @defgroup Templates Templates
- */
-
if ( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
}
-/**
- * @ingroup Templates
- */
-class UsercreateTemplate extends QuickTemplate {
+class UsercreateTemplate extends BaseTemplate {
+
+ /**
+ * 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,
}
function execute() {
- 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
- }
- $this->html( 'message' );
-?>
- </div>
- <div class="visualClear"></div>
-<?php
- }
+ global $wgCookieExpiration;
+ $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
?>
-
-<div id="signupstart"><?php $this->msgWiki( 'signupstart' ); ?></div>
-<div id="userlogin">
-
-<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
+<div class="mw-ui-container">
+ <?php
if ( $this->haveData( 'languages' ) ) {
- ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php
+ ?>
+ <div id="languagelinks">
+ <p><?php $this->html( 'languages' ); ?></p>
+ </div>
+ <?php
}
+ ?>
+<div id="userloginForm">
+<h2 class="createaccount-join"><?php $this->msg( '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'] ) {
?>
- <table>
- <tr>
- <td class="mw-label"><label for='wpName2'><?php $this->msg( 'yourname' ); ?></label></td>
- <td class="mw-input">
- <?php
- echo Html::input( 'wpName', $this->data['name'], 'text', array(
- 'class' => 'loginText',
+ <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>
+ <label for='wpName2'>
+ <?php $this->msg( 'userlogin-yourname' ); ?>
+
+ <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' => 'mw-input loginText',
'id' => 'wpName2',
'tabindex' => '1',
'size' => '20',
'required',
+ 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text(),
'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',
+ </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'
+ 'size' => '20',
+ 'required',
+ 'placeholder' => $this->getMsg( 'createacct-yourpassword-ph' )->text()
) + User::passwordChangeInputAttribs() ); ?>
- </td>
- </tr>
-<?php
- if ( $this->data['usedomain'] ) {
+ </div>
+ <?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">
+ ?>
+ <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>
- </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">
- <?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">
- <?php
- echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
- 'class' => 'loginText',
- 'id' => 'wpEmail',
- 'tabindex' => '6',
- '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' );
- } ?>
- </div>
- </td>
-<?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>
-<?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
- }
-?>
- </tr>
-<?php
- if ( $this->data['canremember'] ) {
-?>
- <tr>
- <td></td>
- <td class="mw-input">
+ </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' => '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
- global $wgCookieExpiration;
- $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
- echo Xml::checkLabel(
- wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
- 'wpRemember',
- 'wpRemember',
- $this->data['remember'],
- array( 'tabindex' => '9' )
- )
+ $this->msg( $this->data['emailrequired'] ?
+ 'createacct-emailrequired' :
+ 'createacct-emailoptional'
+ );
?>
- </td>
- </tr>
-<?php
- }
-
- $tabIndex = 10;
+ </label>
+ <?php
+ echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
+ 'class' => 'mw-input loginText',
+ 'id' => 'wpEmail',
+ 'tabindex' => '6',
+ 'size' => '20',
+ 'placeholder' => $this->getMsg( 'createacct-email-ph' )->text()
+ ) + ( $this->data['emailrequired'] ? array() : array( 'required' => '' ) ) );
+ ?>
+ <?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 $this->msgWiki( 'prefs-help-realname' ); ?>
+ </div>
+ </div>
+ <?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 }
+ $tabIndex = 9;
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'] );
+ <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 {
- echo '1';
- }
- ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
+ // Not a checkbox.
+ // TODO (bug 31909) support other input types, e.g. select boxes.
+ if ( !empty( $inputItem['msg'] ) ) {
+ // Output the message label
+ ?>
+ <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>">
+ <?php $this->msgWiki( $inputItem['msg'] ); ?>
+ </label>
<?php
- if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) ) {
- echo 'checked="checked"';
- }
- ?> /> <?php
- if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
- ?>
- <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
- $this->msgHtml( $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
+ }
if ( $inputItem['helptext'] !== false ) {
?>
- <div class="prefsectiontip">
- <?php $this->msgWiki( $inputItem['helptext'] ); ?>
- </div><?php
+ <div class="prefsectiontip">
+ <?php $this->msgWiki( $inputItem['helptext'] ); ?>
+ </div>
+ <?php
}
?>
- </td>
- </tr>
-<?php
+ </div>
+ <?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
- }
- if ( $this->haveData( 'token' ) ) {
- ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php
- }
-?>
+ // JS attempts to move the image CAPTCHA below this part of the form,
+ // so skip one index.
+ $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' ); ?>" />
+ </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>
</div>
-<div id="signupend"><?php $this->html( 'signupend' ); ?></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
+ }
+ ?>
+ </div>
+</div>
+</div>
<?php
}
+++ /dev/null
-<?php
-/**
- * Html form for account creation with new 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Templates
- */
-
-if ( !defined( 'MEDIAWIKI' ) ) {
- die( -1 );
-}
-
-/**
- * Html form for create account with new VForm appearance.
- *
- * @since 1.22
- */
-class UsercreateTemplateVForm extends BaseTemplate {
-
- /**
- * 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,
- 'value' => $value,
- 'type' => $type,
- 'msg' => $msg,
- 'helptext' => $helptext,
- );
- }
-
- function execute() {
- global $wgCookieExpiration;
- $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
-?>
-<div class="mw-ui-container">
- <?php
- if ( $this->haveData( 'languages' ) ) {
- ?>
- <div id="languagelinks">
- <p><?php $this->html( 'languages' ); ?></p>
- </div>
- <?php
- }
- ?>
-<div id="userloginForm">
-<h2 class="createaccount-join"><?php $this->msg( '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>
- <label for='wpName2'>
- <?php $this->msg( 'userlogin-yourname' ); ?>
-
- <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' => 'mw-input loginText',
- 'id' => 'wpName2',
- 'tabindex' => '1',
- 'size' => '20',
- 'required',
- 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text(),
- 'autofocus'
- ) ); ?>
- </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' => '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' => 'mw-input loginText',
- 'id' => 'wpEmail',
- 'tabindex' => '6',
- 'size' => '20',
- 'placeholder' => $this->getMsg( 'createacct-email-ph' )->text()
- ) + ( $this->data['emailrequired'] ? array() : array( 'required' => '' ) ) );
- ?>
- <?php
- // VForm eliminates the prefsectiontip div tip:
- // prefs-help-email-required is redundant with the placeholder text
- // Doesn't show the wordy prefs-help-email
- // Doesn't show the wordy prefs-help-email-others
- ?>
- <?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 $this->msgWiki( 'prefs-help-realname' ); ?>
- </div>
- </div>
- <?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 }
- $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.
- if ( !empty( $inputItem['msg'] ) ) {
- // Output the message label
- ?>
- <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
- }
- 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">
- <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' ); ?>" />
- </div>
- <input type="hidden" id="useNew" name="useNew" value="1" />
-<?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>
-</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
- }
- ?>
- </div>
-</div>
-</div>
-<?php
-
- }
-}
<?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
* @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">
+<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' ); ?>">
+ <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( 'loginerror' ); ?></strong><br /><?php
- }
?>
- <?php $this->html( 'message' ); ?>
- </div>
- <div class="visualClear"></div><?php
-
- }
-?>
-<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
+ <strong><?php $this->msg( 'loginerror' ) ?></strong><br />
+ <?php
}
-?>
- <table>
- <tr>
- <td class="mw-label"><label for='wpName1'><?php $this->msg( 'yourname' ); ?></label></td>
- <td class="mw-input">
+ $this->html( 'message' );
+ ?>
+ </div>
+ <?php
+ }
+ ?>
+ <div>
+ <label for='wpName1'>
<?php
+ $this->msg( 'userlogin-yourname' );
+ 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();
+ // Set focus to this field if its blank.
+ if ( !$this->data['name'] ) {
+ $extraAttrs['autofocus'] = '';
+ }
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' => '' ) ) ); ?>
+ // 'required' is blacklisted for now in Html.php due to browser issues.
+ // Keeping here in case that changes
+ 'required',
+ 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text()
+ ) + $extraAttrs );
+ ?>
+ </div>
+ <div>
+ <label for='wpPassword1'>
+ <?php
+ $this->msg( 'userlogin-yourpassword' );
- </td>
- </tr>
- <tr>
- <td class="mw-label"><label for='wpPassword1'><?php $this->msg( 'yourpassword' ); ?></label></td>
- <td class="mw-input">
- <?php
+ 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
+ $extraAttrs = array();
+ // Set focus to this field if username is filled in.
+ if ( $this->data['name'] ) {
+ $extraAttrs['autofocus'] = '';
+ }
echo Html::input( 'wpPassword', null, 'password', array(
'class' => 'loginPassword',
'id' => 'wpPassword1',
'tabindex' => '2',
- 'size' => '20'
- ) + ( $this->data['name'] ? array( 'autofocus' ) : array() ) ); ?>
-
- </td>
- </tr>
-<?php
- if ( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
+ 'size' => '20',
+ 'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
+ ) + $extraAttrs );
+ ?>
+ </div>
+ <?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' ) ?>"
+ ?>
+ <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>
- </td>
- </tr>
-<?php
- }
+ </div>
+ <?php }
- if ( $this->haveData( 'extrafields' ) ) {
- echo $this->data['extrafields'];
- }
+ if ( $this->haveData( 'extrafields' ) ) {
+ echo $this->data['extrafields'];
+ } ?>
- 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' => '8' )
- )
- ?>
- </td>
- </tr>
-<?php
- }
+ <div>
- if ( $this->data['cansecurelogin'] ) {
-?>
- <tr>
- <td></td>
- <td class="mw-input">
- <?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 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>
+
+ <?php if ( $this->data['cansecurelogin'] ) { ?>
+ <div>
+ <label class="mw-ui-checkbox-label">
+ <input name="wpStickHTTPS" type="checkbox" value="1" id="wpStickHTTPS" tabindex="5"
+ <?php if ( $this->data['stickHTTPS'] ) {
+ echo 'checked="checked"';
+ } ?>
+ >
+ <?php $this->msg( 'securelogin-stick-https' ); ?>
+ </label>
+ </div>
+ <?php } ?>
+ <div>
<?php
- echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
+ echo Html::input( 'wpLoginAttempt', $this->getMsg( 'login' )->text(), 'submit', array(
'id' => 'wpLoginAttempt',
- 'tabindex' => '9'
+ 'tabindex' => '6',
+ 'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-primary'
) );
- 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'
- )
- );
- }
- }
-?>
- </td>
- </tr>
- </table>
-<?php
- if ( $this->haveData( 'uselang' ) ) {
- ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php
- }
-
- if ( $this->haveData( 'token' ) ) {
- ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php
- }
-?>
+ ?>
+ </div>
+ <div id="mw-userlogin-help">
+ <?php echo $this->getMsg( 'userlogin-helplink' )->parse(); ?>
+ </div>
+ <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?>
+ <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 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>
-<div id="loginend"><?php $this->html( 'loginend' ); ?></div>
+</div>
<?php
-
}
}
+++ /dev/null
-<?php
-/**
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Templates
- */
-
-
-/**
- * Html form for user login with new VForm appearance.
- */
-class UserloginTemplateVForm extends BaseTemplate {
-
- function execute() {
- global $wgCookieExpiration;
- $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
-?>
-<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' ); ?>">
- <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( 'loginerror' ) ?></strong><br />
- <?php
- }
- $this->html( 'message' );
- ?>
- </div>
- <?php
- }
- ?>
- <div>
- <label for='wpName1'>
- <?php
- $this->msg( 'userlogin-yourname' );
- 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();
- // Set focus to this field if its blank.
- if ( !$this->data['name'] ) {
- $extraAttrs['autofocus'] = '';
- }
- 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',
- 'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text()
- ) + $extraAttrs );
- ?>
- </div>
- <div>
- <label for='wpPassword1'>
- <?php
- $this->msg( 'userlogin-yourpassword' );
-
- 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' )
- );
- // TODO: remove the wpMailmypassword code branch from
- // templates/Userlogin.php as well; it is never executed and
- // doesn't work.
- }
- ?>
- </label>
- <?php
- $extraAttrs = array();
- // Set focus to this field if username is filled in.
- if ( $this->data['name'] ) {
- $extraAttrs['autofocus'] = '';
- }
- echo Html::input( 'wpPassword', null, 'password', array(
- 'class' => 'loginPassword',
- 'id' => 'wpPassword1',
- 'tabindex' => '2',
- 'size' => '20',
- 'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
- ) + $extraAttrs );
- ?>
- </div>
- <?php
- 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 }
-
- if ( $this->haveData( 'extrafields' ) ) {
- echo $this->data['extrafields'];
- } ?>
-
- <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>
-
- <?php if ( $this->data['cansecurelogin'] ) { ?>
- <div>
- <label class="mw-ui-checkbox-label">
- <input name="wpStickHTTPS" type="checkbox" value="1" id="wpStickHTTPS" tabindex="5"
- <?php if ( $this->data['stickHTTPS'] ) {
- echo 'checked="checked"';
- } ?>
- >
- <?php $this->msg( 'securelogin-stick-https' ); ?>
- </label>
- </div>
- <?php } ?>
- <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' ) ) { ?>
- <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 } ?>
- <input type="hidden" id="mw-useNew" name="useNew" value="1" />
-<?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>
-</div>
-<?php
- }
-}
'welcomeuser' => 'Welcome, $1!',
'welcomecreation-msg' => 'Your account has been created.
Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].',
-'yourname' => 'Username:',
'userlogin-yourname' => 'Username',
'userlogin-yourname-ph' => 'Enter your username',
'createacct-helpusername' => '', # do not translate or duplicate this message to other languages
'userlogin-yourpassword' => 'Password',
'userlogin-yourpassword-ph' => 'Enter your password',
'createacct-yourpassword-ph' => 'Enter a password',
-'yourpasswordagain' => 'Retype password:',
'createacct-yourpasswordagain' => 'Confirm password',
'createacct-yourpasswordagain-ph' => 'Enter password again',
'remembermypassword' => 'Remember my login on this browser (for a maximum of $1 {{PLURAL:$1|day|days}})',
'login' => 'Log in',
'nav-login-createaccount' => 'Log in / create account',
'loginprompt' => 'You must have cookies enabled to log in to {{SITENAME}}.',
-'userlogin' => 'Log in / create account',
-'userloginnocreate' => 'Log in',
'logout' => 'Log out',
'userlogout' => 'Log out',
'userlogout-summary' => '', # do not translate or duplicate this message to other languages
'notloggedin' => 'Not logged in',
'userlogin-noaccount' => "Don't have an account?",
'userlogin-joinproject' => 'Join {{SITENAME}}',
-'nologin' => "Don't have an account? $1.",
-'nologinlink' => 'Create an account',
'createaccount' => 'Create account',
-'gotaccount' => 'Already have an account? $1.',
-'gotaccountlink' => 'Log in',
-'userlogin-resetlink' => 'Forgotten your login details?',
'userlogin-resetpassword-link' => 'Reset your password',
'helplogin-url' => 'Help:Logging in',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Help with logging in]]',
'createacct-email-ph' => 'Enter your 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-reason' => 'Reason',
'createacct-reason-ph' => 'Why you are creating another account',
'createacct-captcha' => 'Security check',
* $1 - an URL to [[Special:Userlogin]] containing <code>returnto</code> and <code>returntoquery</code> parameters',
'welcomeuser' => 'Text for a welcome heading that users see after registering a user account. $1 is the username of the new user. See [[bugzilla:42215]]',
'welcomecreation-msg' => 'A welcome message users see after registering a user account, following a welcomeuser heading. $1 is the username of the new user. Replaces welcomecreation in 1.21wmf5,see [[bugzilla:42215]]',
-'yourname' => "{{doc-important|<nowiki>{{</nowiki>[[Gender|GENDER]]<nowiki>}}</nowiki> is '''NOT''' supported.}}
-In user preferences.
-{{Identical|Username}}",
-'userlogin-yourname' => 'In new vertical user login & create account forms, label for username field.
+'userlogin-yourname' => "In user login & create account forms, label for username field.
+{{doc-important|<nowiki>{{</nowiki>[[Gender|GENDER]]<nowiki>}}</nowiki> is '''NOT''' supported.}}
-See examples: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1] and [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
-{{Identical|Username}}',
-'userlogin-yourname-ph' => 'Placeholder text in new userlogin/create account form field.
+See examples: [{{canonicalurl:Special:UserLogin}} Special:UserLogin] and [{{canonicalurl:Special:UserLogin}} Special:UserLogin]
+{{Identical|Username}}",
+'userlogin-yourname-ph' => 'Placeholder text in login & create account form field.
-See example: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1] and [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin}} Special:UserLogin] and [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'yourpassword' => 'In user preferences
{{Identical|Password}}',
-'userlogin-yourpassword' => 'In new vertical user login & create account forms, label for password field.
+'userlogin-yourpassword' => 'In login & create account forms, label for password field.
-See examples: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1] and [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See examples: [{{canonicalurl:Special:UserLogin}} Special:UserLogin] and [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
{{Identical|Password}}',
-'userlogin-yourpassword-ph' => 'Placeholder text in new userlogin form for password field.
+'userlogin-yourpassword-ph' => 'Placeholder text in login form for password field.
-See examples: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1] and [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See examples: [{{canonicalurl:Special:UserLogin}} Special:UserLogin] and [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
{{Identical|Enter password}}',
-'createacct-yourpassword-ph' => 'Placeholder text in new create account form for password field.
+'createacct-yourpassword-ph' => 'Placeholder text in create account form for password field.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
{{Identical|Enter password}}',
-'yourpasswordagain' => 'In user preferences',
-'createacct-yourpasswordagain' => 'In new create account form, label for field to re-enter password
+'createacct-yourpasswordagain' => 'In create account form, label for field to re-enter password
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
{{Identical|Confirm password}}',
-'createacct-yourpasswordagain-ph' => 'Placeholder text in new create account form for re-enter password field.
+'createacct-yourpasswordagain-ph' => 'Placeholder text in create account form for re-enter password field.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'remembermypassword' => 'A check box in [[Special:UserLogin]]
{{Identical|Remember my login on this computer}}',
'userlogin-remembermypassword' => 'The text for a check box in the new-style [[Special:UserLogin]].
-See example: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin}} Special:UserLogin]',
'userlogin-signwithsecure' => 'Text of link to HTTPS login form.
-See example: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin}} Special:UserLogin]',
'securelogin-stick-https' => 'Used as label for checkbox.',
'yourdomainname' => 'Used as label for listbox.',
'password-change-forbidden' => 'Error message shown when an external authentication source does not allow the password to be changed.',
'nav-login-createaccount' => "Shown to anonymous users in the upper right corner of the page. When you can't create an account, the message {{msg-mw|login}} is shown.
{{Identical|Log in / create account}}",
'loginprompt' => 'A small notice in the log in form.',
-'userlogin' => 'Name of special page [[Special:UserLogin]] where a user can log in or click to create a user account.
-{{Identical|Log in / create account}}',
-'userloginnocreate' => 'A variant of {{msg-mw|Userlogin}} when the user is not allowed to create a new account.
-
-{{Identical|Log in}}',
'logout' => 'Used as link text in your personal toolbox (upper right side).
See also:
'notloggedin' => 'This message is displayed in the standard skin when not logged in. The message is placed above the login link in the top right corner of pages.
{{Identical|Not logged in}}',
-'userlogin-noaccount' => 'In the new-style [[Special:Userlogin]] form, this is the text prior to button inviting user to join project.
+'userlogin-noaccount' => 'In the [[Special:Userlogin]] form, this is the text prior to button inviting user to join project.
-See example: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1]
+See example: [{{canonicalurl:Special:UserLogin}} Special:UserLogin]
{{Identical|Do not have an account}}',
'userlogin-joinproject' => 'Text of button inviting user to create an account.
-See example: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1]',
-'nologin' => 'A message shown in the log in form. Parameters:
-* $1 - a link to the account creation form, and the text of it is {{msg-mw|Nologinlink}}
-{{Identical|Do not have an account}}',
-'nologinlink' => 'Text of the link to the account creation form. Before that link, the message {{msg-mw|Nologin}} appears.
-{{Identical|Create an account}}',
+See example: [{{canonicalurl:Special:UserLogin}} Special:UserLogin]',
'createaccount' => 'Used on the top of the page for logged out users, where it appears next to {{msg-mw|login}}, so consider making them similar.
It is also used on the submit button in the form/special page where you register a new account.
{{doc-special|CreateAccount}}
{{Identical|Create account}}',
-'gotaccount' => 'A message shown in the account creation form.
-* $1 - a link to the log in form, and the text of it is {{msg-mw|Gotaccountlink}}',
-'gotaccountlink' => 'Text of the link to the log in form. Before that link, the message {{msg-mw|Gotaccount}} appears.
-{{Identical|Log in}}',
-'userlogin-resetlink' => 'Used on the login page.',
-'userlogin-resetpassword-link' => 'Used as link text on new vertical-layout create account form.
+'userlogin-resetpassword-link' => 'Used as link text on login form.
The link points to the local [[Special:PasswordReset]].
-See example: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1]
+See example: [{{canonicalurl:Special:UserLogin}} Special:UserLogin]
userlogin-resetpassword-link may have to be shorter than the old {{msg-mw|userlogin-resetlink}}',
'helplogin-url' => '{{doc-important|Do not translate the namespace name <code>Help</code>.}}
'userlogin-helplink' => '{{doc-important|Do not change <code><nowiki>{{MediaWiki:helplogin-url}}</nowiki></code>.}}
Wikitext linking to login help.
-See example: [{{canonicalurl:Special:UserLogin|useNew=1}} Special:UserLogin?useNew=1]
+See example: [{{canonicalurl:Special:UserLogin}} Special:UserLogin]
See also:
* {{msg-mw|Helplogin-url}}',
'createacct-join' => 'Subheading of vertical-layout create account form encouraging user to join the wiki.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+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.
See also:
{{Identical|E-mail address}}',
'createacct-emailoptional' => 'Label in vertical-layout create account form for email field when it is optional.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
See also:
* {{msg-mw|Createacct-emailrequired}}',
'createacct-email-ph' => 'Placeholder in vertical-layout create account form for email field.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'createaccountmail' => 'Used as 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]] if creating accounts by e-mail is allowed.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'createacct-realname' => 'In vertical-layout create account form, label for field to enter optional real name.',
-'createaccountreason' => '{{Identical|Reason}}',
-'createacct-reason' => 'In vertical-layout create account form, label for field to enter reason to create an account when already logged-in.
+'createacct-reason' => 'In create account form, label for field to enter reason to create an account when already logged-in.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
{{Identical|Reason}}',
'createacct-reason-ph' => 'Placeholder in vertical-layout create account form for reason field.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'createacct-captcha' => 'Label in vertical-layout create account form for CAPTCHA input field when repositioned by JavaScript.',
'createacct-imgcaptcha-ph' => 'Placehodler text in vertical-layout create account form for image CAPTCHA input field when repositioned by JavaScript.',
'createacct-submit' => 'Submit button on vertical-layout create account form.
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'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&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'createacct-benefit-body1' => 'In vertical-layout create account form, the text for the first benefit.
Preceded by the message {{msg-mw|Createacct-benefit-head1}} (number of edits).
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
{{Identical|Edit}}',
'createacct-benefit-body2' => 'In vertical-layout create account form, the text for the second benefit.
Preceded by the message {{msg-mw|Createacct-benefit-head2}} (number of pages).
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]
{{Identical|Page}}',
'createacct-benefit-body3' => 'In vertical-layout create account form, the text for the third benefit.
Preceded by the message {{msg-mw|Createacct-benefit-head3}} (number of contributors).
-See example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]',
+See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'badretype' => 'Used as error message when the new password and its retype do not match.',
'userexists' => 'Used as error message in creating a user account.',
'loginerror' => 'Used as title of error message.
$1 is the minimum number of characters in the password.',
'password-name-match' => 'Used as error message when password validity check failed.',
'password-login-forbidden' => 'Error message shown when the user has tried to log in using one of the special username/password combinations used for MediaWiki testing. (See [[mwr:75589]], [[mwr:75605]].)',
-'mailmypassword' => 'Shown at [[Special:UserLogin]]',
+'mailmypassword' => 'Heading in [[Special:PasswordReset]]',
'passwordremindertitle' => 'Title of e-mail which contains temporary password',
'passwordremindertext' => 'This text is used in an e-mail sent when a user requests a new temporary password (he has forgotten his password) or when an sysop creates a new user account choosing to have password and username sent to the new user by e-mail.
* $1 is an IP address. Example: 123.123.123.123
'logouttext',
'welcomeuser',
'welcomecreation-msg',
- 'yourname',
'userlogin-yourname',
'userlogin-yourname-ph',
'createacct-helpusername',
'userlogin-yourpassword',
'userlogin-yourpassword-ph',
'createacct-yourpassword-ph',
- 'yourpasswordagain',
'createacct-yourpasswordagain',
'createacct-yourpasswordagain-ph',
'remembermypassword',
'login',
'nav-login-createaccount',
'loginprompt',
- 'userlogin',
- 'userloginnocreate',
'logout',
'userlogout',
'userlogout-summary',
'notloggedin',
'userlogin-noaccount',
'userlogin-joinproject',
- 'nologin',
- 'nologinlink',
'createaccount',
- 'gotaccount',
- 'gotaccountlink',
- 'userlogin-resetlink',
'userlogin-resetpassword-link',
'helplogin-url',
'userlogin-helplink',
'createacct-email-ph',
'createaccountmail',
'createacct-realname',
- 'createaccountreason',
'createacct-reason',
'createacct-reason-ph',
'createacct-captcha',
),
'dependencies' => array( 'mediawiki.libs.jpegmeta', 'mediawiki.util' ),
),
- 'mediawiki.special.userlogin.signup' => array(
- 'scripts' => 'resources/mediawiki.special/mediawiki.special.userLogin.signup.js',
- ),
- 'mediawiki.special.userlogin.vform' => array(
+ 'mediawiki.special.userlogin' => array(
'styles' => array(
'resources/mediawiki.special/mediawiki.special.vforms.css',
- 'resources/mediawiki.special/mediawiki.special.userLogin.vform.css',
+ 'resources/mediawiki.special/mediawiki.special.userLogin.css',
),
'position' => 'top',
),
- 'mediawiki.special.createaccount.vform' => array(
+ 'mediawiki.special.createaccount' => array(
'styles' => array(
'resources/mediawiki.special/mediawiki.special.vforms.css',
- 'resources/mediawiki.special/mediawiki.special.createAccount.vform.css',
+ 'resources/mediawiki.special/mediawiki.special.createAccount.css',
),
- 'position' => 'top',
),
- 'mediawiki.special.createaccount.vform.js' => array(
- 'scripts' => 'resources/mediawiki.special/mediawiki.special.createAccount.vform.js',
+ 'mediawiki.special.createaccount.js' => array(
+ 'scripts' => 'resources/mediawiki.special/mediawiki.special.createAccount.js',
'messages' => array(
'createacct-captcha',
'createacct-imgcaptcha-ph'
--- /dev/null
+/* Disable the underline that Vector puts on h2 headings, and bold them. */
+.mw-ui-container h2 {
+ border: 0;
+ font-weight: bold;
+}
+
+/**** shuffled CAPTCHA ****/
+#wpCaptchaWord {
+ margin-top: 6px;
+}
+
+.mw-createacct-captcha-container {
+ background-color: #f8f8f8;
+ border: 1px solid #c9c9c9;
+ padding: 10px;
+ text-align: center;
+}
+
+.mw-createacct-captcha-assisted {
+ display: block;
+ margin-top: 0.5em;
+}
+
+/* Put a border around the fancycaptcha-image-container. */
+.mw-createacct-captcha-and-reload {
+ border: 1px solid #c9c9c9;
+ display: table-cell; /* Other display formats end up too wide */
+ width: 270px;
+ background-color: #FFF;
+}
+
+/* Make the fancycaptcha-image-container full-width within its parent. */
+.fancycaptcha-image-container
+{
+ width: 100%;
+}
+
+/**** Benefits column CSS to the right (if it fits) of the form. ****/
+.mw-ui-container #userloginForm {
+ float: left;
+}
+
+div.mw-createacct-benefits-container {
+ /* Keeps this column compact and close to the form, but tends to squish contents. */
+ float: left;
+}
+
+div.mw-createacct-benefits-container h2 {
+ margin-bottom: 30px;
+}
+
+.mw-number-text.icon-edits {
+ /* @embed */
+ background: url(images/icon-edits.png) no-repeat left center;
+}
+
+.mw-number-text.icon-pages {
+ /* @embed */
+ background: url(images/icon-pages.png) no-repeat left center;
+}
+
+.mw-number-text.icon-contributors {
+ /* @embed */
+ background: url(images/icon-contributors.png) no-repeat left center;
+}
+
+/* Special font for numbers in benefits*/
+div.mw-number-text h3 {
+ top: 0;
+ margin: 0;
+ padding: 0;
+ color: #252525;
+ font-family: 'Georgia', serif;
+ font-weight: normal;
+ font-size: 2.2em;
+ line-height: 1.2;
+ text-align: center;
+}
+
+/* Contains a number and explanatory text, with space for an icon */
+div.mw-number-text {
+ display: block;
+ font-size: 1.2em;
+ color: #444;
+ margin-top: 1em;
+ padding: 0 0 0 95px; /* 80px wide icon plus "margin" */
+ min-height: 75px; /* matches max icon height, ensures icon emblem is visible */
+ text-align: center;
+}
--- /dev/null
+/**
+ * JavaScript for Create account form (Special:UserLogin?type=signup).
+ */
+( function ( mw, $ ) {
+
+ // When sending password by email, hide the password input fields.
+ // This function doesn't need to be loaded early by ResourceLoader, but is tiny.
+ function hidePasswordOnEmail( $ ) {
+ $( '#wpCreateaccountMail' )
+ .on( 'change', function() {
+ $( '.mw-row-password' ).toggle( !$( this ).attr( 'checked' ) );
+ } )
+ .trigger( 'change' );
+ }
+
+ // Move the FancyCaptcha image into a more attractive container.
+ // This function does need to be run early by ResourceLoader.
+ function adjustFancyCaptcha( $, mw ) {
+ var $content = $( '#mw-content-text' ),
+ $submit = $content.find( '#wpCreateaccount' ),
+ tabIndex,
+ $captchaStuff,
+ $captchaImageContainer,
+ // JavaScript can't yet parse the message createacct-imgcaptcha-help when it
+ // contains a MediaWiki transclusion, so PHP parses it and sends the HTML.
+ helpMsg = mw.config.get( 'wgCreateacctImgcaptchaHelp' ),
+ helpHtml = '';
+
+ /*
+ * CAPTCHA
+ * The CAPTCHA is in a div style="captcha" at the top of the form.
+ * If it's a FancyCaptcha, then we remove it and insert it lower down,
+ * in a customized div with just what we need (e.g. no
+ * fancycaptcha-createaccount message).
+ */
+ if ( !$submit.length) {
+ return;
+ }
+ tabIndex = $submit.prop( 'tabindex' ) - 1;
+ $captchaStuff = $content.find ( '.captcha' );
+
+ if ( $captchaStuff.length ) {
+
+ // The FancyCaptcha has this class in the ConfirmEdit extension
+ // after 2013-04-18.
+ $captchaImageContainer = $captchaStuff.find( '.fancycaptcha-image-container' );
+ if ( $captchaImageContainer.length !== 1 ) {
+ return;
+ }
+
+ $captchaStuff.remove();
+
+ if ( helpMsg) {
+ helpHtml = '<small class="mw-createacct-captcha-assisted">' + helpMsg + '</small>';
+ }
+
+ // Insert another div before the submit button that will include the
+ // repositioned FancyCaptcha div, an input field, and possible help.
+ $submit.closest( 'div' )
+ .before( [
+ '<div>',
+ '<label for="wpCaptchaWord">' + mw.message( 'createacct-captcha' ).escaped() + '</label>',
+ '<div class="mw-createacct-captcha-container">',
+ '<div class="mw-createacct-captcha-and-reload" />',
+ '<input id="wpCaptchaWord" name="wpCaptchaWord" type="text" placeholder="' +
+ mw.message( 'createacct-imgcaptcha-ph' ).escaped() +
+ '" tabindex="' + tabIndex + '" autocapitalize="off" autocorrect="off">',
+ helpHtml,
+ '</div>',
+ '</div>'
+ ].join( '' )
+ );
+
+ // Stick the FancyCaptcha container inside our bordered and framed parents.
+ $captchaImageContainer
+ .prependTo( $content.find( '.mw-createacct-captcha-and-reload' ) );
+
+ // Find the input field, add the text (if any) of the existing CAPTCHA
+ // field (although usually it's blanked out on every redisplay),
+ // and after it move over the hidden field that tells the CAPTCHA
+ // what to do.
+ $content.find( '#wpCaptchaWord' )
+ .val( $captchaStuff.find( '#wpCaptchaWord' ).val() )
+ .after( $captchaStuff.find( '#wpCaptchaId' ) );
+ }
+ }
+
+ $( document ).ready( function( $ ) {
+ adjustFancyCaptcha( $, mw);
+ hidePasswordOnEmail( $ );
+ } );
+
+}( mediaWiki, jQuery ) );
+++ /dev/null
-/* Disable the underline that Vector puts on h2 headings, and bold them. */
-.mw-ui-container h2 {
- border: 0;
- font-weight: bold;
-}
-
-/**** shuffled CAPTCHA ****/
-#wpCaptchaWord {
- margin-top: 6px;
-}
-
-.mw-createacct-captcha-container {
- background-color: #f8f8f8;
- border: 1px solid #c9c9c9;
- padding: 10px;
- text-align: center;
-}
-
-.mw-createacct-captcha-assisted {
- display: block;
- margin-top: 0.5em;
-}
-
-/* Put a border around the fancycaptcha-image-container. */
-.mw-createacct-captcha-and-reload {
- border: 1px solid #c9c9c9;
- display: table-cell; /* Other display formats end up too wide */
- width: 270px;
- background-color: #FFF;
-}
-
-/* Make the fancycaptcha-image-container full-width within its parent. */
-.fancycaptcha-image-container
-{
- width: 100%;
-}
-
-/**** Benefits column CSS to the right (if it fits) of the form. ****/
-.mw-ui-container #userloginForm {
- float: left;
-}
-
-div.mw-createacct-benefits-container {
- /* Keeps this column compact and close to the form, but tends to squish contents. */
- float: left;
-}
-
-div.mw-createacct-benefits-container h2 {
- margin-bottom: 30px;
-}
-
-.mw-number-text.icon-edits {
- /* @embed */
- background: url(images/icon-edits.png) no-repeat left center;
-}
-
-.mw-number-text.icon-pages {
- /* @embed */
- background: url(images/icon-pages.png) no-repeat left center;
-}
-
-.mw-number-text.icon-contributors {
- /* @embed */
- background: url(images/icon-contributors.png) no-repeat left center;
-}
-
-/* Special font for numbers in benefits*/
-div.mw-number-text h3 {
- top: 0;
- margin: 0;
- padding: 0;
- color: #252525;
- font-family: 'Georgia', serif;
- font-weight: normal;
- font-size: 2.2em;
- line-height: 1.2;
- text-align: center;
-}
-
-/* Contains a number and explanatory text, with space for an icon */
-div.mw-number-text {
- display: block;
- font-size: 1.2em;
- color: #444;
- margin-top: 1em;
- padding: 0 0 0 95px; /* 80px wide icon plus "margin" */
- min-height: 75px; /* matches max icon height, ensures icon emblem is visible */
- text-align: center;
-}
+++ /dev/null
-/**
- * JavaScript for Create account form (Special:UserLogin?type=signup).
- */
-( function ( mw, $ ) {
-
- $( document ).ready( function( $ ) {
- var $content = $( '#mw-content-text' ),
- $submit = $content.find( '#wpCreateaccount' ),
- tabIndex,
- $captchaStuff,
- $captchaImageContainer,
- // JavaScript can't yet parse the message createacct-imgcaptcha-help when it
- // contains a MediaWiki transclusion, so PHP parses it and sends the HTML.
- helpMsg = mw.config.get( 'wgCreateacctImgcaptchaHelp' ),
- helpHtml = '';
-
- /*
- * CAPTCHA
- * The CAPTCHA is in a div style="captcha" at the top of the form.
- * If it's a FancyCaptcha, then we remove it and insert it lower down,
- * in a customized div with just what we need (e.g. no
- * fancycaptcha-createaccount message).
- */
- if ( !$submit.length) {
- return;
- }
- tabIndex = $submit.prop( 'tabindex' ) - 1;
- $captchaStuff = $content.find ( '.captcha' );
-
- if ( $captchaStuff.length ) {
-
- // The FancyCaptcha has this class in the ConfirmEdit extension
- // after 2013-04-18.
- $captchaImageContainer = $captchaStuff.find( '.fancycaptcha-image-container' );
- if ( $captchaImageContainer.length !== 1 ) {
- return;
- }
-
- $captchaStuff.remove();
-
- if ( helpMsg) {
- helpHtml = '<small class="mw-createacct-captcha-assisted">' + helpMsg + '</small>';
- }
-
- // Insert another div before the submit button that will include the
- // repositioned FancyCaptcha div, an input field, and possible help.
- $submit.closest( 'div' )
- .before( [
- '<div>',
- '<label for="wpCaptchaWord">' + mw.message( 'createacct-captcha' ).escaped() + '</label>',
- '<div class="mw-createacct-captcha-container">',
- '<div class="mw-createacct-captcha-and-reload" />',
- '<input id="wpCaptchaWord" name="wpCaptchaWord" type="text" placeholder="' +
- mw.message( 'createacct-imgcaptcha-ph' ).escaped() +
- '" tabindex="' + tabIndex + '" autocapitalize="off" autocorrect="off">',
- helpHtml,
- '</div>',
- '</div>'
- ].join( '' )
- );
-
- // Stick the FancyCaptcha container inside our bordered and framed parents.
- $captchaImageContainer
- .prependTo( $content.find( '.mw-createacct-captcha-and-reload' ) );
-
- // Find the input field, add the text (if any) of the existing CAPTCHA
- // field (although usually it's blanked out on every redisplay),
- // and after it move over the hidden field that tells the CAPTCHA
- // what to do.
- $content.find( '#wpCaptchaWord' )
- .val( $captchaStuff.find( '#wpCaptchaWord' ).val() )
- .after( $captchaStuff.find( '#wpCaptchaId' ) );
- }
-
- } );
-
-}( mediaWiki, jQuery ) );
--- /dev/null
+/* Styles just for VForm user login */
+#mw-userlogin-help {
+ text-align: center;
+}
+
+.mw-ui-vform .mw-secure {
+ /* @embed */
+ background: url(images/icon-lock.png) no-repeat scroll left center transparent;
+ margin: 0 0 0 1px;
+ padding: 0 0 0 11px;
+}
+
+/* The login form invites users to create an account */
+#mw-createaccount-cta {
+ width: 20em;
+ height: 10em;
+ text-align: center;
+ /* @embed */
+ background: url(images/glyph-people-large.png) no-repeat 50%;
+ margin: 0 auto;
+}
+
+#mw-createaccount-cta h3 {
+ font-size: 0.9em;
+ font-weight: normal;
+ text-align: center;
+ padding-top: 4em;
+}
+
+#mw-createaccount-join {
+ margin-left: 0.75em;
+ /* Separate from background image */
+ box-shadow: 4px 4px 4px 4px rgba(255, 255, 255, 1);
+ width: auto;
+ display: inline-block;
+}
+++ /dev/null
-/**
- * JavaScript for Special:UserLogin/signup
- */
-jQuery( document ).ready( function ( $ ) {
- $( '#wpCreateaccountMail' )
- .on( 'change', function() {
- $( '.mw-row-password' ).toggle( !$( this ).attr( 'checked' ) );
- } )
- .trigger( 'change' );
-} );
+++ /dev/null
-/* Styles just for VForm user login */
-#mw-userlogin-help {
- text-align: center;
-}
-
-.mw-ui-vform .mw-secure {
- /* @embed */
- background: url(images/icon-lock.png) no-repeat scroll left center transparent;
- margin: 0 0 0 1px;
- padding: 0 0 0 11px;
-}
-
-/* The login form invites users to create an account */
-#mw-createaccount-cta {
- width: 20em;
- height: 10em;
- text-align: center;
- /* @embed */
- background: url(images/glyph-people-large.png) no-repeat 50%;
- margin: 0 auto;
-}
-
-#mw-createaccount-cta h3 {
- font-size: 0.9em;
- font-weight: normal;
- text-align: center;
- padding-top: 4em;
-}
-
-#mw-createaccount-join {
- margin-left: 0.75em;
- /* Separate from background image */
- box-shadow: 4px 4px 4px 4px rgba(255, 255, 255, 1);
- width: auto;
- display: inline-block;
-}