X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLCheckMatrix.php;h=a0566a039649c1f0ef79ab724da3aac1673f948b;hb=adb0c734befa5aff7362bbbc010785af40e543a2;hp=7ccb60e04eaa203e784bbd87d04ea6149ce2507f;hpb=70a1ea48aa5f789d78d0f43c31049380f952ca8c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLCheckMatrix.php b/includes/htmlform/HTMLCheckMatrix.php index 7ccb60e04e..a0566a0396 100644 --- a/includes/htmlform/HTMLCheckMatrix.php +++ b/includes/htmlform/HTMLCheckMatrix.php @@ -119,9 +119,8 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { foreach ( $columns as $columnTag ) { $thisTag = "$columnTag-$rowTag"; // Construct the checkbox - $thisId = "{$this->mID}-$thisTag"; $thisAttribs = array( - 'id' => $thisId, + 'id' => "{$this->mID}-$thisTag", 'value' => $thisTag, ); $checked = in_array( $thisTag, (array)$value, true ); @@ -132,18 +131,13 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { $checked = true; $thisAttribs['disabled'] = 1; } - $chkBox = $this->getOneCheckbox( $checked, $attribs + $thisAttribs ); - if ( $this->mParent->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) { - $chkBox = Html::openElement( 'div', array( 'class' => 'mw-ui-checkbox' ) ) . - $chkBox . - Html::element( 'label', array( 'for' => $thisId ) ) . - Html::closeElement( 'div' ); - } + $checkbox = $this->getOneCheckbox( $checked, $attribs + $thisAttribs ); + $rowContents .= Html::rawElement( 'td', array(), - $chkBox + $checkbox ); } $tableContents .= Html::rawElement( 'tr', array(), "\n$rowContents\n" ); @@ -162,11 +156,18 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { return new OOUI\CheckboxInputWidget( array( 'name' => "{$this->mName}[]", 'selected' => $checked, - 'value' => '1', + 'value' => $attribs['value'], ) + $attribs ); + } else { + $checkbox = Xml::check( "{$this->mName}[]", $checked, $attribs ); + if ( $this->mParent->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) { + $checkbox = Html::openElement( 'div', array( 'class' => 'mw-ui-checkbox' ) ) . + $checkbox . + Html::element( 'label', array( 'for' => $attribs['id'] ) ) . + Html::closeElement( 'div' ); + } + return $checkbox; } - - return Xml::check( "{$this->mName}[]", $checked, $attribs ); } protected function isTagForcedOff( $tag ) {