* @return string
*/
function getInputHTML( $value ) {
- global $wgUseMediaWikiUIEverywhere;
-
$html = '';
$tableContents = '';
$rows = $this->mParams['rows'];
$thisAttribs['disabled'] = 1;
}
$chkBox = Xml::check( "{$this->mName}[]", $checked, $attribs + $thisAttribs );
- if ( $wgUseMediaWikiUIEverywhere ) {
+ if ( $this->mParent->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
$chkBox = Html::openElement( 'div', array( 'class' => 'mw-ui-checkbox' ) ) .
$chkBox .
Html::element( 'label', array( 'for' => $thisId ) ) .
$helptext = $this->getHelpTextHtmlTable( $this->getHelpText() );
$cellAttributes = array( 'colspan' => 2 );
+ $hideClass = '';
+ $hideAttributes = array();
+ if ( $this->mHideIf ) {
+ $hideAttributes['data-hide-if'] = FormatJson::encode( $this->mHideIf );
+ $hideClass = 'mw-htmlform-hide-if';
+ }
+
$label = $this->getLabelHtml( $cellAttributes );
$field = Html::rawElement(
$inputHtml . "\n$errors"
);
- $html = Html::rawElement( 'tr', array( 'class' => 'mw-htmlform-vertical-label' ), $label );
+ $html = Html::rawElement( 'tr',
+ array( 'class' => "mw-htmlform-vertical-label $hideClass" ) + $hideAttributes,
+ $label );
$html .= Html::rawElement( 'tr',
- array( 'class' => "mw-htmlform-field-$fieldType {$this->mClass} $errorClass" ),
+ array( 'class' => "mw-htmlform-field-$fieldType {$this->mClass} $errorClass $hideClass" ) +
+ $hideAttributes,
$field );
return $html . $helptext;