Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1014,8 +1014,12 @@ |
1015 | 1015 | 'prefs-help-gender', |
1016 | 1016 | 'email', |
1017 | 1017 | 'prefs-help-realname', |
| 1018 | + |
| 1019 | + # 3 messages depending upon wgEmailConfirmToEdit and $wgEnableUserEmail |
1018 | 1020 | 'prefs-help-email', |
| 1021 | + 'prefs-help-email-others', |
1019 | 1022 | 'prefs-help-email-required', |
| 1023 | + |
1020 | 1024 | 'prefs-info', |
1021 | 1025 | 'prefs-i18n', |
1022 | 1026 | 'prefs-signature', |
Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -33,6 +33,10 @@ |
34 | 34 | * 'help-message' -- message key for a message to use as a help text. |
35 | 35 | * can be an array of msg key and then parameters to |
36 | 36 | * the message. |
| 37 | + * Overwrites 'help-messages'. |
| 38 | + * 'help-messages' -- array of message key. As above, each item can |
| 39 | + * be an array of msg key and then parameters. |
| 40 | + * Overwrites 'help-message'. |
37 | 41 | * 'required' -- passed through to the object, indicating that it |
38 | 42 | * is a required field. |
39 | 43 | * 'size' -- the length of text fields |
— | — | @@ -898,6 +902,17 @@ |
899 | 903 | # Never mind |
900 | 904 | $helptext = null; |
901 | 905 | } |
| 906 | + } elseif ( isset( $this->mParams['help-messages'] ) ) { |
| 907 | + # help-message can be passed a message key (string) or an array containing |
| 908 | + # a message key and additional parameters. This makes it impossible to pass |
| 909 | + # an array of message key |
| 910 | + foreach( $this->mParams['help-messages'] as $msg ) { |
| 911 | + $candidate = wfMsgExt( $msg, 'parseinline' ); |
| 912 | + if( wfEmptyMsg( $msg ) ) { |
| 913 | + $candidate = null; |
| 914 | + } |
| 915 | + $helptext .= $candidate; // append message |
| 916 | + } |
902 | 917 | } elseif ( isset( $this->mParams['help'] ) ) { |
903 | 918 | $helptext = $this->mParams['help']; |
904 | 919 | } |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -925,7 +925,8 @@ |
926 | 926 | * @private |
927 | 927 | */ |
928 | 928 | function mainLoginForm( $msg, $msgtype = 'error' ) { |
929 | | - global $wgUser, $wgOut, $wgHiddenPrefs, $wgEnableEmail; |
| 929 | + global $wgUser, $wgOut, $wgHiddenPrefs; |
| 930 | + global $wgEnableEmail, $wgEnableUserEmail; |
930 | 931 | global $wgRequest, $wgLoginLanguageSelector; |
931 | 932 | global $wgAuth, $wgEmailConfirmToEdit, $wgCookieExpiration; |
932 | 933 | global $wgSecureLogin; |
— | — | @@ -1014,6 +1015,7 @@ |
1015 | 1016 | $template->set( 'userealname', !in_array( 'realname', $wgHiddenPrefs ) ); |
1016 | 1017 | $template->set( 'useemail', $wgEnableEmail ); |
1017 | 1018 | $template->set( 'emailrequired', $wgEmailConfirmToEdit ); |
| 1019 | + $template->set( 'emailothers', $wgEnableUserEmail ); |
1018 | 1020 | $template->set( 'canreset', $wgAuth->allowPasswordChange() ); |
1019 | 1021 | $template->set( 'canremember', ( $wgCookieExpiration > 0 ) ); |
1020 | 1022 | $template->set( 'usereason', $wgUser->isLoggedIn() ); |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -325,19 +325,25 @@ |
326 | 326 | global $wgEnableEmail; |
327 | 327 | if ( $wgEnableEmail ) { |
328 | 328 | global $wgEmailConfirmToEdit; |
| 329 | + global $wgEnableUserEmail; |
329 | 330 | |
| 331 | + $helpMessages[] = $wgEmailConfirmToEdit |
| 332 | + ? 'prefs-help-email-required' |
| 333 | + : 'prefs-help-email' ; |
| 334 | + $helpMessages[] = $wgEnableUserEmail |
| 335 | + ? 'prefs-help-email-others' |
| 336 | + : 'tototo' ; |
| 337 | + |
330 | 338 | $defaultPreferences['emailaddress'] = array( |
331 | 339 | 'type' => $wgAuth->allowPropChange( 'emailaddress' ) ? 'email' : 'info', |
332 | 340 | 'default' => $user->getEmail(), |
333 | 341 | 'section' => 'personal/email', |
334 | 342 | 'label-message' => 'youremail', |
335 | | - 'help-message' => $wgEmailConfirmToEdit |
336 | | - ? 'prefs-help-email-required' |
337 | | - : 'prefs-help-email', |
| 343 | + 'help-messages' => $helpMessages, |
338 | 344 | 'validation-callback' => array( 'Preferences', 'validateEmail' ), |
339 | 345 | ); |
340 | 346 | |
341 | | - global $wgEnableUserEmail, $wgEmailAuthentication; |
| 347 | + global $wgEmailAuthentication; |
342 | 348 | |
343 | 349 | $disableEmailPrefs = false; |
344 | 350 | |
Index: trunk/phase3/includes/templates/Userlogin.php |
— | — | @@ -255,11 +255,15 @@ |
256 | 256 | 'size' => '20' |
257 | 257 | ) ); ?> |
258 | 258 | <div class="prefsectiontip"> |
259 | | - <?php if( $this->data['emailrequired'] ) { |
260 | | - $this->msgWiki('prefs-help-email-required'); |
261 | | - } else { |
262 | | - $this->msgWiki('prefs-help-email'); |
263 | | - } ?> |
| 259 | + <?php // duplicated in Preferences.php profilePreferences() |
| 260 | + if( $this->data['emailrequired'] ) { |
| 261 | + $this->msgWiki('prefs-help-email-required'); |
| 262 | + } else { |
| 263 | + $this->msgWiki('prefs-help-email'); |
| 264 | + } |
| 265 | + if( $this->data['emailothers'] ) { |
| 266 | + $this->msgWiki('prefs-help-email-others'); |
| 267 | + } ?> |
264 | 268 | </div> |
265 | 269 | </td> |
266 | 270 | <td></td> |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1839,8 +1839,8 @@ |
1840 | 1840 | 'email' => 'E-mail', |
1841 | 1841 | 'prefs-help-realname' => 'Real name is optional. |
1842 | 1842 | If you choose to provide it, this will be used for giving you attribution for your work.', |
1843 | | -'prefs-help-email' => 'E-mail address is optional, but is needed for password resets, should you forget your password. |
1844 | | -You can also choose to let others contact you through your user or talk page without needing to reveal your identity.', |
| 1843 | +'prefs-help-email' => 'E-mail address is optional, but is needed for password resets, should you forget your password.', |
| 1844 | +'prefs-help-email-others' => 'You can also choose to let others contact you through your user or talk page without needing to reveal your identity.', |
1845 | 1845 | 'prefs-help-email-required' => 'E-mail address is required.', |
1846 | 1846 | 'prefs-info' => 'Basic information', |
1847 | 1847 | 'prefs-i18n' => 'Internationalisation', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -77,6 +77,8 @@ |
78 | 78 | selected when the action is "purge". |
79 | 79 | * (bug 14267) Support a MediaWiki:Mainpage-nstab override for the subject namespace |
80 | 80 | tab on the mainpage of a wiki. |
| 81 | +* (bug 10158) Do not mention allowing others to contact you when the feature |
| 82 | + is disabled ($wgEnableUserEmail=false) |
81 | 83 | |
82 | 84 | === API changes in 1.18 === |
83 | 85 | * (bug 26339) Throw warning when truncating an overlarge API result |