X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLCheckMatrix.php;h=83f126657f5ab2c3c536a6a4f5efb117121c81c2;hb=5161541d87d663ea86b66258a568349a6cc8fde9;hp=825552696f2190ac13013634185fb987f941de12;hpb=222727927abfe04a3116e4f7671e7628b14fe661;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLCheckMatrix.php b/includes/htmlform/HTMLCheckMatrix.php index 825552696f..83f126657f 100644 --- a/includes/htmlform/HTMLCheckMatrix.php +++ b/includes/htmlform/HTMLCheckMatrix.php @@ -80,8 +80,6 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { * @return string */ function getInputHTML( $value ) { - global $wgUseMediaWikiUIEverywhere; - $html = ''; $tableContents = ''; $rows = $this->mParams['rows']; @@ -129,7 +127,7 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { $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 ) ) . @@ -180,6 +178,13 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { $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( @@ -188,9 +193,12 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { $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;