r58166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58165‎ | r58166 | r58167 >
Date:22:29, 26 October 2009
Author:yaron
Status:deferred
Tags:
Comment:
Better class definition for checkboxes input, fixed 'disabled' handling for category input
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormInputs.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.inc
@@ -224,9 +224,10 @@
225225 static function checkboxesHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args) {
226226 global $sfgTabIndex, $sfgFieldNum;
227227
228 - $className = ($is_mandatory) ? "mandatoryField" : "createboxInput";
 228+ $checkbox_class = ($is_mandatory) ? "mandatoryField" : "createboxInput";
 229+ $span_class = "checkboxSpan";
229230 if (array_key_exists('class', $other_args))
230 - $className .= " " . $other_args['class'];
 231+ $span_class .= " " . $other_args['class'];
231232 $input_id = "input_$sfgFieldNum";
232233 $info_id = "info_$sfgFieldNum";
233234 $hidden_input_name = $input_name . "[is_list]";
@@ -250,9 +251,7 @@
251252 $cur_input_name = $input_name . "[" . $key . "]";
252253 $checked_text = (in_array($possible_value, $cur_values)) ? 'checked="checked"' : "";
253254 $text .=<<<END
254 - <span class="checkboxSpan">
255 - <input type="checkbox" id="$input_id" tabindex="$sfgTabIndex" name="$cur_input_name" value="$possible_value" class="$className" $checked_text $disabled_text/> $possible_value
256 - </span>
 255+ <span class="$span_class"><input type="checkbox" id="$input_id" tabindex="$sfgTabIndex" name="$cur_input_name" value="$possible_value" class="$checkbox_class" $checked_text $disabled_text/> $possible_value</span>
257256
258257 END;
259258 $sfgTabIndex++;
@@ -676,6 +675,7 @@
677676 $text .= ' checked="checked"';
678677 $check_set = true;
679678 }
 679+ $disabled_text = ($is_disabled) ? "disabled" : "";
680680 $text .= " $disabled_text/> <em>" . wfMsg('sf_editdata_none') . "</em>\n";
681681 }
682682

Status & tagging log