Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -30,13 +30,14 @@ |
31 | 31 | * the message. |
32 | 32 | * 'label' -- alternatively, a raw text message. Overridden by |
33 | 33 | * label-message |
| 34 | + * 'help' -- message text for a message to use as a help text. |
34 | 35 | * 'help-message' -- message key for a message to use as a help text. |
35 | 36 | * can be an array of msg key and then parameters to |
36 | 37 | * the message. |
37 | | - * Overwrites 'help-messages'. |
| 38 | + * Overwrites 'help-messages' and 'help'. |
38 | 39 | * 'help-messages' -- array of message key. As above, each item can |
39 | 40 | * be an array of msg key and then parameters. |
40 | | - * Overwrites 'help-message'. |
| 41 | + * Overwrites 'help'. |
41 | 42 | * 'required' -- passed through to the object, indicating that it |
42 | 43 | * is a required field. |
43 | 44 | * 'size' -- the length of text fields |
— | — | @@ -1086,31 +1087,29 @@ |
1087 | 1088 | $helptext = null; |
1088 | 1089 | |
1089 | 1090 | if ( isset( $this->mParams['help-message'] ) ) { |
1090 | | - $helpMessage = (array)$this->mParams['help-message']; |
1091 | | - $msg = wfMessage( array_shift( $helpMessage ), $helpMessage ); |
| 1091 | + $this->mParams['help-messages'] = (array)$this->mParams['help-message']; |
| 1092 | + } |
1092 | 1093 | |
1093 | | - if ( $msg->exists() ) { |
1094 | | - $helptext = $msg->parse(); |
1095 | | - } |
1096 | | - } elseif ( isset( $this->mParams['help-messages'] ) ) { |
1097 | | - # help-message can be passed a message key (string) or an array containing |
1098 | | - # a message key and additional parameters. This makes it impossible to pass |
1099 | | - # an array of message key |
| 1094 | + if ( isset( $this->mParams['help-messages'] ) ) { |
1100 | 1095 | foreach( $this->mParams['help-messages'] as $name ) { |
1101 | 1096 | $helpMessage = (array)$name; |
1102 | 1097 | $msg = wfMessage( array_shift( $helpMessage ), $helpMessage ); |
1103 | 1098 | |
1104 | 1099 | if( $msg->exists() ) { |
1105 | | - $helptext .= $msg->parse(); // append message |
| 1100 | + $helptext .= $msg->parse(); // Append message |
1106 | 1101 | } |
1107 | 1102 | } |
1108 | | - } elseif ( isset( $this->mParams['help'] ) ) { |
| 1103 | + } |
| 1104 | + elseif ( isset( $this->mParams['help'] ) ) { |
1109 | 1105 | $helptext = $this->mParams['help']; |
1110 | 1106 | } |
1111 | 1107 | |
1112 | 1108 | if ( !is_null( $helptext ) ) { |
1113 | | - $row = Html::rawElement( 'td', array( 'colspan' => 2, 'class' => 'htmlform-tip' ), |
1114 | | - $helptext ); |
| 1109 | + $row = Html::rawElement( |
| 1110 | + 'td', |
| 1111 | + array( 'colspan' => 2, 'class' => 'htmlform-tip' ), |
| 1112 | + $helptext |
| 1113 | + ); |
1115 | 1114 | $row = Html::rawElement( 'tr', array(), $row ); |
1116 | 1115 | $html .= "$row\n"; |
1117 | 1116 | } |