X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLFormField.php;h=4cf23942ff66805c7506269fd249362434bc3eec;hb=38d59dd21347dc5167fbef94a0558f6bbdcd4195;hp=1fcc8661cb906e39cb073aaaa4c9ce2306a61e66;hpb=f3cace56e73b8e3e9561449aad9ee7e39d896f05;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 1fcc8661cb..4cf23942ff 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -35,7 +35,7 @@ abstract class HTMLFormField { * 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. @@ -113,7 +113,7 @@ abstract class HTMLFormField { } $data = $data[$key]; } - $testValue = $data; + $testValue = (string)$data; break; } @@ -125,7 +125,7 @@ abstract class HTMLFormField { * * @param array $alldata * @param array $params - * @return boolean + * @return bool */ protected function isHiddenRecurse( array $alldata, array $params ) { $origParams = $params; @@ -250,7 +250,7 @@ abstract class HTMLFormField { * @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; @@ -264,7 +264,7 @@ abstract class HTMLFormField { * @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 ) { @@ -593,6 +593,9 @@ abstract class HTMLFormField { $wrapperAttributes = array( 'class' => 'htmlform-tip', ); + if ( $this->mHelpClass !== false ) { + $wrapperAttributes['class'] .= " {$this->mHelpClass}"; + } if ( $this->mHideIf ) { $wrapperAttributes['data-hide-if'] = FormatJson::encode( $this->mHideIf ); $wrapperAttributes['class'] .= ' mw-htmlform-hide-if';