LoginSignupSpecialPage: Restore old display of 'createacct-helpusername'
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 25 Aug 2016 20:23:17 +0000 (22:23 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 25 Aug 2016 20:23:53 +0000 (22:23 +0200)
Note that this message is empty by default. You'll have to create it
on your wiki to see effects of this change.

Bug: T143923
Change-Id: I509c13775426b8d51f65c95af49dffb84ccaa0f4

includes/specialpage/LoginSignupSpecialPage.php

index 22c38cb..c3d43df 100644 (file)
@@ -835,6 +835,12 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                                'class' => 'mw-ui-flush-right mw-secure',
                        ], $this->msg( 'userlogin-signwithsecure' )->text() );
                }
+               $usernameHelpLink = '';
+               if ( !$this->msg( 'createacct-helpusername' )->isDisabled() ) {
+                       $usernameHelpLink = Html::rawElement( 'span', [
+                               'class' => 'mw-ui-flush-right',
+                       ], $this->msg( 'createacct-helpusername' )->parse() );
+               }
 
                if ( $this->isSignup() ) {
                        $fieldDefinitions = [
@@ -847,9 +853,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                                        'weight' => -105,
                                ],
                                'username' => [
-                                       'label-message' => 'userlogin-yourname',
-                                       // FIXME help-message does not match old formatting
-                                       'help-message' => 'createacct-helpusername',
+                                       'label-raw' => $this->msg( 'userlogin-yourname' )->escaped() . $usernameHelpLink,
                                        'id' => 'wpName2',
                                        'placeholder-message' => $isLoggedIn ? 'createacct-another-username-ph'
                                                : 'userlogin-yourname-ph',