diff options
author | Antoine Musso <hashar@users.mediawiki.org> | 2011-01-14 16:53:36 +0000 |
---|---|---|
committer | Antoine Musso <hashar@users.mediawiki.org> | 2011-01-14 16:53:36 +0000 |
commit | 83848f26d9155e6a9ce712d886393bd2702641c1 (patch) | |
tree | a56e7ca039336cdfa237f321833de63c29379e37 /includes/HTMLForm.php | |
parent | 8dc6f041c19c944f8393b34a6fb8660960a16540 (diff) | |
download | mediawikicore-83848f26d9155e6a9ce712d886393bd2702641c1.tar.gz mediawikicore-83848f26d9155e6a9ce712d886393bd2702641c1.zip |
bug 10158 : do not mention allowing others to contact you if $wgEnableUserEmail=false
This required to tweak HTMLForm to support an array of message keys
for help message. I could reuse help-message but since this helper
also supports array, I created an additional helper for array of
messages.
To test use variations of $wgEnableUserEmail and $wgEmailConfirmToEdit.
Path adapted from jopiswezggzmw at mailinator dot com
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/80281
Diffstat (limited to 'includes/HTMLForm.php')
-rw-r--r-- | includes/HTMLForm.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index d46275481e22..2e7e3999bdce 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -33,6 +33,10 @@ * 'help-message' -- message key for a message to use as a help text. * can be an array of msg key and then parameters to * the message. + * Overwrites 'help-messages'. + * 'help-messages' -- array of message key. As above, each item can + * be an array of msg key and then parameters. + * Overwrites 'help-message'. * 'required' -- passed through to the object, indicating that it * is a required field. * 'size' -- the length of text fields @@ -898,6 +902,17 @@ abstract class HTMLFormField { # Never mind $helptext = null; } + } elseif ( isset( $this->mParams['help-messages'] ) ) { + # help-message can be passed a message key (string) or an array containing + # a message key and additional parameters. This makes it impossible to pass + # an array of message key + foreach( $this->mParams['help-messages'] as $msg ) { + $candidate = wfMsgExt( $msg, 'parseinline' ); + if( wfEmptyMsg( $msg ) ) { + $candidate = null; + } + $helptext .= $candidate; // append message + } } elseif ( isset( $this->mParams['help'] ) ) { $helptext = $this->mParams['help']; } |