protected $mLabel; # String label. Set on construction
protected $mID;
protected $mClass = '';
+ protected $mHelpClass = false;
protected $mDefault;
protected $mOptions = false;
protected $mOptionsLabelsNotFromMessage = false;
* the input object itself. It should not implement the surrounding
* table cells/rows, or labels/help messages.
*
- * @param string $value the value to set the input to; eg a default
+ * @param string $value The value to set the input to; eg a default
* text for a text input.
*
* @return string Valid HTML.
}
$data = $data[$key];
}
- $testValue = $data;
+ $testValue = (string)$data;
break;
}
*
* @param array $alldata
* @param array $params
- * @return boolean
+ * @return bool
*/
protected function isHiddenRecurse( array $alldata, array $params ) {
$origParams = $params;
* @param string|array $value The value the field was submitted with
* @param array $alldata The data collected from the form
*
- * @return bool true to cancel the submission
+ * @return bool True to cancel the submission
*/
function cancelSubmit( $value, $alldata ) {
return false;
* @param string|array $value The value the field was submitted with
* @param array $alldata The data collected from the form
*
- * @return bool|string true on success, or String error to display, or
+ * @return bool|string True on success, or String error to display, or
* false to fail validation without displaying an error.
*/
function validate( $value, $alldata ) {
$this->mClass = $params['cssclass'];
}
+ if ( isset( $params['csshelpclass'] ) ) {
+ $this->mHelpClass = $params['csshelpclass'];
+ }
+
if ( isset( $params['validation-callback'] ) ) {
$this->mValidationCallback = $params['validation-callback'];
}
$rowAttributes['class'] = 'mw-htmlform-hide-if';
}
- $row = Html::rawElement( 'td', array( 'colspan' => 2, 'class' => 'htmlform-tip' ), $helptext );
+ $tdClasses = array( 'htmlform-tip' );
+ if ( $this->mHelpClass !== false ) {
+ $tdClasses[] = $this->mHelpClass;
+ }
+ $row = Html::rawElement( 'td', array( 'colspan' => 2, 'class' => $tdClasses ), $helptext );
$row = Html::rawElement( 'tr', $rowAttributes, $row );
return $row;