r82187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82186‎ | r82187 | r82188 >
Date:20:00, 15 February 2011
Author:kipcool
Status:deferred
Tags:
Comment:
corrected another bug with checkboxes
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/forms.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/forms.php
@@ -30,7 +30,11 @@
3131 // a disabled checkbox returns no value, as if unchecked
3232 // therefore the value of a disabled, but checked, checkbox must be sent with a hidden input
3333 if ( $disabled ) {
34 - return '<input disabled="disabled" type="checkbox" name="' . $name . checkBoxCheckAttribute( $isChecked ) . '/><input type="hidden" name="' . $name . '" value="' . $isChecked . '"/>';
 34+ if ( $isChecked ) {
 35+ return '<input disabled="disabled" type="checkbox" name="' . $name . checkBoxCheckAttribute( $isChecked ) . '/><input type="hidden" name="' . $name . '" value="1"/>';
 36+ } else {
 37+ return '<input disabled="disabled" type="checkbox" name="' . $name . checkBoxCheckAttribute( $isChecked ) . '/>';
 38+ }
3539 } else {
3640 return '<input type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '/>';
3741 }
@@ -38,7 +42,11 @@
3943
4044 function getCheckBoxWithOnClick( $name, $isChecked, $onClick, $disabled = false ) {
4145 if ( $disabled ) {
42 - return '<input disabled="disabled" type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '"/><input type="hidden" name="' . $name . '" value="' . $isChecked . '"/>';
 46+ if ( $isChecked ) {
 47+ return '<input disabled="disabled" type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '"/><input type="hidden" name="' . $name . '" value="1"/>';
 48+ } else {
 49+ return '<input disabled="disabled" type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '"/>';
 50+ }
4351 } else {
4452 return '<input type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . ' onclick="' . $onClick . '"/>';
4553 }

Status & tagging log