Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc |
— | — | @@ -23,13 +23,13 @@ |
24 | 24 | // in the form definition |
25 | 25 | $this->mSemanticTypeHooks = array(); |
26 | 26 | if ($smwgContLang != null) { |
27 | | - $this->setSemanticTypeHook($smwgContLang->smwDatatypeLabels['smw_string'], array('SFFormPrinter', 'textEntryHTML'), array('size' => 35)); |
28 | | - $this->setSemanticTypeHook($smwgContLang->smwDatatypeLabels['smw_url'], array('SFFormPrinter', 'textEntryHTML'), array('size' => 100)); |
29 | | - $this->setSemanticTypeHook($smwgContLang->smwDatatypeLabels['smw_float'], array('SFFormPrinter', 'textEntryHTML'), array('size' => 10)); |
30 | | - $this->setSemanticTypeHook($smwgContLang->smwDatatypeLabels['smw_int'], array('SFFormPrinter', 'textEntryHTML'), array('size' => 10)); |
31 | | - $this->setSemanticTypeHook($smwgContLang->smwDatatypeLabels['smw_bool'], array('SFFormPrinter', 'checkboxHTML'), array()); |
32 | | - $this->setSemanticTypeHook($smwgContLang->smwDatatypeLabels['smw_datetime'], array('SFFormPrinter', 'dateEntryHTML'), array()); |
33 | | - $this->setSemanticTypeHook($smwgContLang->smwDatatypeLabels['smw_enum'], array('SFFormPrinter', 'dropdownHTML'), array()); |
| 27 | + $this->setSemanticTypeHook($smwgContLang->getDatatypeLabel('smw_string'), array('SFFormPrinter', 'textEntryHTML'), array('size' => 35)); |
| 28 | + $this->setSemanticTypeHook($smwgContLang->getDatatypeLabel('smw_url'), array('SFFormPrinter', 'textEntryHTML'), array('size' => 100)); |
| 29 | + $this->setSemanticTypeHook($smwgContLang->getDatatypeLabel('smw_float'), array('SFFormPrinter', 'textEntryHTML'), array('size' => 10)); |
| 30 | + $this->setSemanticTypeHook($smwgContLang->getDatatypeLabel('smw_int'), array('SFFormPrinter', 'textEntryHTML'), array('size' => 10)); |
| 31 | + $this->setSemanticTypeHook($smwgContLang->getDatatypeLabel('smw_bool'), array('SFFormPrinter', 'checkboxHTML'), array()); |
| 32 | + $this->setSemanticTypeHook($smwgContLang->getDatatypeLabel('smw_datetime'), array('SFFormPrinter', 'dateEntryHTML'), array()); |
| 33 | + $this->setSemanticTypeHook($smwgContLang->getDatatypeLabel('smw_enum'), array('SFFormPrinter', 'dropdownHTML'), array()); |
34 | 34 | $this->setSemanticTypeHook('relation', array('SFFormPrinter', 'textEntryWithAutocompleteHTML'), array('size' => 35)); |
35 | 35 | } |
36 | 36 | $this->mInputTypeHooks = array(); |
— | — | @@ -40,6 +40,8 @@ |
41 | 41 | $this->setInputTypeHook('datetime with timezone', array('SFFormPrinter', 'dateTimeEntryHTML'), array('include_timezone' => true)); |
42 | 42 | $this->setInputTypeHook('checkbox', array('SFFormPrinter', 'checkboxHTML'), array()); |
43 | 43 | $this->setInputTypeHook('radiobutton', array('SFFormPrinter', 'radioButtonHTML'), array()); |
| 44 | + $this->setInputTypeHook('listbox', array('SFFormPrinter', 'listboxHTML'), array()); |
| 45 | + $this->setInputTypeHook('checkboxes', array('SFFormPrinter', 'checkboxesHTML'), array()); |
44 | 46 | |
45 | 47 | // initialize other variables |
46 | 48 | $this->standardInputsIncluded = false; |
— | — | @@ -362,9 +364,9 @@ |
363 | 365 | if ($is_hidden) { |
364 | 366 | $new_text = $this->hiddenFieldHTML('free_text', '<free_text>'); |
365 | 367 | } else { |
366 | | - if ($field_args['rows'] == null) |
| 368 | + if (! array_key_exists('rows', $field_args)) |
367 | 369 | $field_args['rows'] = 5; |
368 | | - if ($field_args['cols'] == null) |
| 370 | + if (! array_key_exists('cols', $field_args)) |
369 | 371 | $field_args['cols'] = 30; |
370 | 372 | $sfgTabIndex++; |
371 | 373 | $sfgFieldNum++; |
— | — | @@ -377,54 +379,72 @@ |
378 | 380 | $section = substr_replace($section, $new_text, $brackets_loc, $brackets_end_loc + 3 - $brackets_loc); |
379 | 381 | } else { // this field is part of a template |
380 | 382 | if (is_array($cur_value)) { |
381 | | - // if it has 1 or 2 elements, assume it's a checkbox; if it has |
382 | | - // 3 elements, assume it's a date |
383 | | - // - this handling will have to get more complex if other |
384 | | - // possibilities get added |
385 | | - if (count($cur_value) == 1) { |
386 | | - $words_for_false = explode(',', wfMsgForContent('smw_false_words')); |
387 | | - // for the various languages, the second word in the 'false' |
388 | | - // series tends to be "no" - go with that one |
389 | | - if (count($words_for_false) > 2) { |
390 | | - $no = $words_for_false[1]; |
391 | | - } elseif (count($words_for_false) == 0) { |
392 | | - $no = "0"; // some safe value if no words are found |
393 | | - } else { |
394 | | - $no = $words_for_false[0]; |
| 383 | + // first, check if it's a list |
| 384 | + if ($cur_value['is_list'] == 1) { |
| 385 | + $cur_value_in_template = ""; |
| 386 | + if (array_key_exists('delimiter', $field_args)) |
| 387 | + $delimiter = $field_args['delimiter']; |
| 388 | + else |
| 389 | + $delimiter = ","; |
| 390 | + foreach ($cur_value as $key => $val) { |
| 391 | + if ($key !== "is_list") { |
| 392 | + if ($cur_value_in_template != "") { |
| 393 | + $cur_value_in_template .= $delimiter . " "; |
| 394 | + } |
| 395 | + $cur_value_in_template .= $val; |
| 396 | + } |
395 | 397 | } |
396 | | - $cur_value_in_template = $no; |
397 | | - } elseif (count($cur_value) == 2) { |
398 | | - $words_for_true = explode(',', wfMsgForContent('smw_true_words')); |
399 | | - // the second word in the 'true' series tends to be "yes" - |
400 | | - // go with that one |
401 | | - if (count($words_for_true) > 2) { |
402 | | - $yes = $words_for_true[1]; |
403 | | - } elseif (count($words_for_true) == 0) { |
404 | | - $yes = "1"; // some safe value if no words are found |
405 | | - } else { |
406 | | - $yes = $words_for_true[0]; |
| 398 | + } else { |
| 399 | + // otherwise: |
| 400 | + // if it has 1 or 2 elements, assume it's a checkbox; if it has |
| 401 | + // 3 elements, assume it's a date |
| 402 | + // - this handling will have to get more complex if other |
| 403 | + // possibilities get added |
| 404 | + if (count($cur_value) == 1) { |
| 405 | + $words_for_false = explode(',', wfMsgForContent('smw_false_words')); |
| 406 | + // for the various languages, the second word in the 'false' |
| 407 | + // series tends to be "no" - go with that one |
| 408 | + if (count($words_for_false) > 2) { |
| 409 | + $no = $words_for_false[1]; |
| 410 | + } elseif (count($words_for_false) == 0) { |
| 411 | + $no = "0"; // some safe value if no words are found |
| 412 | + } else { |
| 413 | + $no = $words_for_false[0]; |
| 414 | + } |
| 415 | + $cur_value_in_template = $no; |
| 416 | + } elseif (count($cur_value) == 2) { |
| 417 | + $words_for_true = explode(',', wfMsgForContent('smw_true_words')); |
| 418 | + // the second word in the 'true' series tends to be "yes" - |
| 419 | + // go with that one |
| 420 | + if (count($words_for_true) > 2) { |
| 421 | + $yes = $words_for_true[1]; |
| 422 | + } elseif (count($words_for_true) == 0) { |
| 423 | + $yes = "1"; // some safe value if no words are found |
| 424 | + } else { |
| 425 | + $yes = $words_for_true[0]; |
| 426 | + } |
| 427 | + $cur_value_in_template = $yes; |
| 428 | + // if it's 3 or greater, assume it's a date or datetime |
| 429 | + } elseif (count($cur_value) >= 3) { |
| 430 | + $month = $cur_value['month']; |
| 431 | + $day = $cur_value['day']; |
| 432 | + $year = $cur_value['year']; |
| 433 | + if (isset($cur_value['hour'])) $hour = $cur_value['hour']; |
| 434 | + if (isset($cur_value['minute'])) $minute = $cur_value['minute']; |
| 435 | + if (isset($cur_value['second'])) $second = $cur_value['second']; |
| 436 | + if (isset($cur_value['ampm24h'])) $ampm24h = $cur_value['ampm24h']; |
| 437 | + if (isset($cur_value['timezone'])) $timezone = $cur_value['timezone']; |
| 438 | + if ($month != '' && $day != '' && $year != '') { |
| 439 | + $cur_value_in_template = "$month $day, $year"; |
| 440 | + // include whatever time information we have |
| 441 | + if(isset($hour)) $cur_value_in_template .= " " . str_pad(intval(substr($hour,0,2)),2,'0',STR_PAD_LEFT) . ":" . str_pad(intval(substr($minute,0,2)),2,'0',STR_PAD_LEFT); |
| 442 | + if(isset($second)) $cur_value_in_template .= ":" . str_pad(intval(substr($second,0,2)),2,'0',STR_PAD_LEFT); |
| 443 | + if(isset($ampm24h)) $cur_value_in_template .= " $ampm24h"; |
| 444 | + if(isset($timezone)) $cur_value_in_template .= " $timezone"; |
| 445 | + } else { |
| 446 | + $cur_value_in_template = ""; |
| 447 | + } |
407 | 448 | } |
408 | | - $cur_value_in_template = $yes; |
409 | | - // if it's 3 or greater, assume it's a date or datetime |
410 | | - } elseif (count($cur_value) >= 3) { |
411 | | - $month = $cur_value['month']; |
412 | | - $day = $cur_value['day']; |
413 | | - $year = $cur_value['year']; |
414 | | - if (isset($cur_value['hour'])) $hour = $cur_value['hour']; |
415 | | - if (isset($cur_value['minute'])) $minute = $cur_value['minute']; |
416 | | - if (isset($cur_value['second'])) $second = $cur_value['second']; |
417 | | - if (isset($cur_value['ampm24h'])) $ampm24h = $cur_value['ampm24h']; |
418 | | - if (isset($cur_value['timezone'])) $timezone = $cur_value['timezone']; |
419 | | - if ($month != '' && $day != '' && $year != '') { |
420 | | - $cur_value_in_template = "$month $day, $year"; |
421 | | - # include whatever time information we have |
422 | | - if(isset($hour)) $cur_value_in_template .= " " . str_pad(intval(substr($hour,0,2)),2,'0',STR_PAD_LEFT) . ":" . str_pad(intval(substr($minute,0,2)),2,'0',STR_PAD_LEFT); |
423 | | - if(isset($second)) $cur_value_in_template .= ":" . str_pad(intval(substr($second,0,2)),2,'0',STR_PAD_LEFT); |
424 | | - if(isset($ampm24h)) $cur_value_in_template .= " $ampm24h"; |
425 | | - if(isset($timezone)) $cur_value_in_template .= " $timezone"; |
426 | | - } else { |
427 | | - $cur_value_in_template = ""; |
428 | | - } |
429 | 449 | } |
430 | 450 | } else { // value is not an array |
431 | 451 | $cur_value_in_template = $cur_value; |
— | — | @@ -545,7 +565,7 @@ |
546 | 566 | $form_text .=<<<END |
547 | 567 | <div id="wrapper_$sfgFieldNum" class="multiple_template"> |
548 | 568 | $section |
549 | | - <input type="button" onclick="removeInstance('wrapper_$sfgFieldNum');" value="$remove_text" tabindex="$sfgTabIndex" /> |
| 569 | + <input type="button" onclick="removeInstance('wrapper_$sfgFieldNum');" value="$remove_text" tabindex="$sfgTabIndex" class="remove" /> |
550 | 570 | </div> |
551 | 571 | |
552 | 572 | END; |
— | — | @@ -567,7 +587,7 @@ |
568 | 588 | $add_another = wfMsg('sf_editdata_addanother'); |
569 | 589 | $form_text .=<<<END |
570 | 590 | <p style="margin-left:10px;"> |
571 | | - <p><input type="button" onclick="addInstance('starter_$query_template_name', 'main_$query_template_name', '$sfgFieldNum');" value="$add_another" tabindex="$sfgTabIndex" /></p> |
| 591 | + <p><input type="button" onclick="addInstance('starter_$query_template_name', 'main_$query_template_name', '$sfgFieldNum');" value="$add_another" tabindex="$sfgTabIndex" class="addAnother" /></p> |
572 | 592 | |
573 | 593 | END; |
574 | 594 | // if a chooser is being used for this template, add the template |
— | — | @@ -749,7 +769,7 @@ |
750 | 770 | //Create remove button |
751 | 771 | var remove_button = document.createElement('input'); |
752 | 772 | remove_button.type = 'button'; |
753 | | - remove_button.value = '$remove_text'; |
| 773 | + remove_button.value = "$remove_text"; |
754 | 774 | remove_button.tabIndex = tab_index; |
755 | 775 | remove_button.onclick = removeInstanceEventHandler(div_id); |
756 | 776 | new_div.appendChild(remove_button); |
— | — | @@ -913,7 +933,7 @@ |
914 | 934 | list($text, $javascript_text) = $this->textEntryHTML($cur_value, $form_field->input_name, $form_field->is_mandatory, $form_field->is_disabled, $field_args); |
915 | 935 | } else { // input type not defined in form, and not a relation |
916 | 936 | $field_type = $template_field->field_type; |
917 | | - if ($field_type != '' && $this->mSemanticTypeHooks[$field_type] != null) { |
| 937 | + if ($field_type != '' && array_key_exists($field_type, $this->mSemanticTypeHooks)) { |
918 | 938 | $hook_values = $this->mSemanticTypeHooks[$field_type]; |
919 | 939 | $funcArgs = array(); |
920 | 940 | $funcArgs[] = $cur_value; |
— | — | @@ -932,7 +952,7 @@ |
933 | 953 | list($text, $javascript_text) = call_user_func_array($hook_values[0], $funcArgs); |
934 | 954 | } else { // anything else |
935 | 955 | $other_args = $form_field->field_args; |
936 | | - if ($other_args['size'] == null) |
| 956 | + if (!array_key_exists('size', $other_args)) |
937 | 957 | $other_args['size'] = 35; |
938 | 958 | list($text, $javascript_text) = $this->textEntryHTML($cur_value, $form_field->input_name, $form_field->is_mandatory, $form_field->is_disabled, $other_args); |
939 | 959 | } |
— | — | @@ -1043,7 +1063,7 @@ |
1044 | 1064 | |
1045 | 1065 | function textEntryHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args) { |
1046 | 1066 | // if it's an autocomplete, call the with-autocomplete function insted |
1047 | | - if ($other_args['autocomplete on'] != null || $other_args['autocomplete on namespace'] != null) { |
| 1067 | + if (array_key_exists('autocomplete on', $other_args) || array_key_exists('autocomplete on namespace', $other_args)) { |
1048 | 1068 | return SFFormPrinter::textEntryWithAutocompleteHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args); |
1049 | 1069 | } |
1050 | 1070 | |
— | — | @@ -1070,7 +1090,7 @@ |
1071 | 1091 | $input_id = "input_$sfgFieldNum"; |
1072 | 1092 | $disabled_text = ($is_disabled) ? "disabled" : ""; |
1073 | 1093 | $text =<<<END |
1074 | | - <select id="$input_id" tabindex="$sfgTabIndex" name="$input_name" class="className" $disabled_text> |
| 1094 | + <select id="$input_id" tabindex="$sfgTabIndex" name="$input_name" class="$className" $disabled_text> |
1075 | 1095 | |
1076 | 1096 | END; |
1077 | 1097 | // add a blank value at the beginning if it's a non-mandatory field |
— | — | @@ -1091,6 +1111,87 @@ |
1092 | 1112 | return array($text, null); |
1093 | 1113 | } |
1094 | 1114 | |
| 1115 | + /* |
| 1116 | + * getValuesArray() - helper function to get an array of values out of |
| 1117 | + * what may be either an array or a delimited string |
| 1118 | + */ |
| 1119 | + function getValuesArray($value, $delimiter) { |
| 1120 | + if (is_array($value)) { |
| 1121 | + return $value; |
| 1122 | + } else { |
| 1123 | + // remove extra spaces |
| 1124 | + return array_map('trim', explode($delimiter, $value)); |
| 1125 | + } |
| 1126 | + } |
| 1127 | + |
| 1128 | + function listboxHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args) { |
| 1129 | + global $sfgTabIndex, $sfgFieldNum; |
| 1130 | + |
| 1131 | + $className = ($is_mandatory) ? "mandatoryField" : "createboxInput"; |
| 1132 | + $input_id = "input_$sfgFieldNum"; |
| 1133 | + $hidden_input_name = $input_name . "[is_list]"; |
| 1134 | + $input_name .= "[]"; // needed so that this input will send an array |
| 1135 | + $disabled_text = ($is_disabled) ? "disabled" : ""; |
| 1136 | + // get list delimiter - default is comma |
| 1137 | + $delimiter = $other_args['delimiter']; |
| 1138 | + if ($delimiter == null) |
| 1139 | + $delimiter = ","; |
| 1140 | + $cur_values = $this->getValuesArray($cur_value, $delimiter); |
| 1141 | + |
| 1142 | + $text =<<<END |
| 1143 | + <select id="$input_id" tabindex="$sfgTabIndex" name="$input_name" class="$className" multiple $disabled_text> |
| 1144 | + |
| 1145 | +END; |
| 1146 | + if (($possible_values = $other_args['possible_values']) == null) |
| 1147 | + $possible_values = array(); |
| 1148 | + foreach ($possible_values as $possible_value) { |
| 1149 | + $text .= " <option value=\"$possible_value\""; |
| 1150 | + if (in_array($possible_value, $cur_values)) {$text .= " selected"; } |
| 1151 | + $text .= ">$possible_value</option>\n"; |
| 1152 | + } |
| 1153 | + $text .=<<<END |
| 1154 | + </select> |
| 1155 | + <span id="$info_id" class="error_message"></span> |
| 1156 | + <input type="hidden" name="$hidden_input_name" value="1" /> |
| 1157 | + |
| 1158 | +END; |
| 1159 | + return array($text, null); |
| 1160 | + } |
| 1161 | + |
| 1162 | + function checkboxesHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args) { |
| 1163 | + global $sfgTabIndex, $sfgFieldNum; |
| 1164 | + |
| 1165 | + $className = ($is_mandatory) ? "mandatoryField" : "createboxInput"; |
| 1166 | + $input_id = "input_$sfgFieldNum"; |
| 1167 | + $hidden_input_name = $input_name . "[is_list]"; |
| 1168 | + $disabled_text = ($is_disabled) ? "disabled" : ""; |
| 1169 | + // get list delimiter - default is comma |
| 1170 | + $delimiter = $other_args['delimiter']; |
| 1171 | + if ($delimiter == null) |
| 1172 | + $delimiter = ","; |
| 1173 | + $cur_values = $this->getValuesArray($cur_value, $delimiter); |
| 1174 | + |
| 1175 | + if (($possible_values = $other_args['possible_values']) == null) |
| 1176 | + $possible_values = array(); |
| 1177 | + foreach ($possible_values as $key => $possible_value) { |
| 1178 | + $cur_input_name = $input_name . "[" . $key . "]"; |
| 1179 | + $checked_text = (in_array($possible_value, $cur_values)) ? 'checked="checked"' : ""; |
| 1180 | + $text .=<<<END |
| 1181 | + <span class="checkboxSpan"> |
| 1182 | + <input type="checkbox" id="$input_id" tabindex="$sfgTabIndex" name="$cur_input_name" value="$possible_value" class="$className" $checked_text $disabled_text/> $possible_value |
| 1183 | + </span> |
| 1184 | + |
| 1185 | +END; |
| 1186 | + $sfgTabIndex++; |
| 1187 | + } |
| 1188 | + $text .=<<<END |
| 1189 | + <span id="$info_id" class="error_message"></span> |
| 1190 | + <input type="hidden" name="$hidden_input_name" value="1" /> |
| 1191 | + |
| 1192 | +END; |
| 1193 | + return array($text, null); |
| 1194 | + } |
| 1195 | + |
1095 | 1196 | function textEntryWithAutocompleteHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args) { |
1096 | 1197 | // if 'no autocomplete' was specified, call the regular text entry instead |
1097 | 1198 | if ($other_args['no_autocomplete'] == true) |
— | — | @@ -1098,13 +1199,13 @@ |
1099 | 1200 | |
1100 | 1201 | global $sfgTabIndex, $sfgFieldNum; |
1101 | 1202 | |
1102 | | - $className = ($is_mandatory) ? "mandatoryField" : "createboxInput"; |
| 1203 | + $className = ($is_mandatory) ? "mandatoryField" : "autocompleteInput"; |
1103 | 1204 | $disabled_text = ($is_disabled) ? "disabled" : ""; |
1104 | 1205 | $size = $other_args['size']; |
1105 | | - if ($other_args['autocomplete on'] != null) { |
| 1206 | + if (array_key_exists('autocomplete on', $other_args)) { |
1106 | 1207 | $autocomplete_field_type = "category"; |
1107 | 1208 | $semantic_field_name = $other_args['autocomplete on']; |
1108 | | - } elseif ($other_args['autocomplete on namespace'] != null) { |
| 1209 | + } elseif (array_key_exists('autocomplete on namespace', $other_args)) { |
1109 | 1210 | $autocomplete_field_type = "namespace"; |
1110 | 1211 | $semantic_field_name = $other_args['autocomplete on namespace']; |
1111 | 1212 | } else { |
— | — | @@ -1220,8 +1321,8 @@ |
1221 | 1322 | } |
1222 | 1323 | $disabled_text = ($is_disabled) ? "disabled" : ""; |
1223 | 1324 | $text = $this->monthDropdownHTML($month, $input_name, $is_disabled); |
1224 | | - $text .= ' <input tabindex="' . $sfgTabIndex . '" id="input_' . $sfgFieldNum . '_2" name="' . $input_name . '[day]" type="text" value="' . $day . '" size="2"/ ' . $disabled_text . '>' . "\n"; |
1225 | | - $text .= ' <input tabindex="' . $sfgTabIndex . '" id="input_' . $sfgFieldNum . '_3" name="' . $input_name . '[year]" type="text" value="' . $year . '" size="4"/ ' . $disabled_text . '>' . "\n"; |
| 1325 | + $text .= ' <input tabindex="' . $sfgTabIndex . '" id="input_' . $sfgFieldNum . '_2" name="' . $input_name . '[day]" type="text" value="' . $day . '" size="2" ' . $disabled_text . '/>' . "\n"; |
| 1326 | + $text .= ' <input tabindex="' . $sfgTabIndex . '" id="input_' . $sfgFieldNum . '_3" name="' . $input_name . '[year]" type="text" value="' . $year . '" size="4" ' . $disabled_text . '/>' . "\n"; |
1226 | 1327 | $info_id = "info_$sfgFieldNum"; |
1227 | 1328 | $text .= " <span id=\"$info_id\" class=\"error_message\"></span>"; |
1228 | 1329 | return array($text, null); |
— | — | @@ -1295,7 +1396,7 @@ |
1296 | 1397 | if (! $is_mandatory) { |
1297 | 1398 | $text .= ' <input type="radio" tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value=""'; |
1298 | 1399 | if (! $cur_value) { |
1299 | | - $text .= " checked"; |
| 1400 | + $text .= ' checked="checked"'; |
1300 | 1401 | $check_set = true; |
1301 | 1402 | } |
1302 | 1403 | $text .= " $disabled_text/> " . wfMsg('sf_editdata_none') . "\n"; |
— | — | @@ -1305,7 +1406,7 @@ |
1306 | 1407 | foreach ($possible_values as $i => $possible_value) { |
1307 | 1408 | $text .= ' <input type="radio" tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value="' . $possible_value . '"'; |
1308 | 1409 | if ($cur_value == $possible_value || (! $cur_value && ! $check_set)) { |
1309 | | - $text .= " checked"; |
| 1410 | + $text .= ' checked="checked"'; |
1310 | 1411 | $check_set = true; |
1311 | 1412 | } |
1312 | 1413 | $text .= " $disabled_text/> $possible_value\n"; |
— | — | @@ -1323,12 +1424,12 @@ |
1324 | 1425 | // can show up here either as an array or a string, depending on |
1325 | 1426 | // whether it came from user input or a wiki page |
1326 | 1427 | if (is_array($cur_value)) { |
1327 | | - $checked_str = ($cur_value[value] == 'on') ? " checked" : ""; |
| 1428 | + $checked_str = ($cur_value[value] == 'on') ? ' checked="checked"' : ""; |
1328 | 1429 | } else { |
1329 | 1430 | // default to false - no need to check if it matches a 'false' word |
1330 | 1431 | $vlc = strtolower(trim($cur_value)); |
1331 | 1432 | if (in_array($vlc, explode(',', wfMsgForContent('smw_true_words')), TRUE)) { |
1332 | | - $checked_str = " checked"; |
| 1433 | + $checked_str = ' checked="checked"'; |
1333 | 1434 | } else { |
1334 | 1435 | $checked_str = ""; |
1335 | 1436 | } |
— | — | @@ -1526,7 +1627,6 @@ |
1527 | 1628 | function formBottom($is_disabled) { |
1528 | 1629 | global $wgUser; |
1529 | 1630 | |
1530 | | - $disabled_text = ($is_disabled) ? "disabled" : ""; |
1531 | 1631 | $summary_text = $this->summaryInputHTML($is_disabled); |
1532 | 1632 | $text =<<<END |
1533 | 1633 | <br /><br /> |