r32342 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32341‎ | r32342 | r32343 >
Date:01:58, 23 March 2008
Author:yaron
Status:old
Tags:
Comment:
Bug fixes
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc
@@ -428,6 +428,7 @@
429429 $input_type = null;
430430 $field_args = array();
431431 $default_value = "";
 432+ $possible_values = null;
432433 $preload_page = null;
433434 for ($i = 2; $i < count($tag_components); $i++) {
434435 $component = trim($tag_components[$i]);
@@ -515,7 +516,7 @@
516517 if (! array_key_exists('rows', $field_args))
517518 $field_args['rows'] = 5;
518519 if (! array_key_exists('cols', $field_args))
519 - $field_args['cols'] = 70;
 520+ $field_args['cols'] = 80;
520521 $sfgTabIndex++;
521522 $sfgFieldNum++;
522523 list($new_text, $new_javascript_text) = $this->textAreaHTML('<free_text>', 'free_text', false, $form_is_disabled, $field_args);
@@ -1524,7 +1525,7 @@
15251526 }
15261527
15271528 // if there are possible values specified, call the dropdown function
1528 - if ($other_args['possible_values'] != null)
 1529+ if (array_key_exists('possible_values', $other_args) && $other_args['possible_values'] != null)
15291530 return SFFormPrinter::dropdownHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args);
15301531
15311532 global $sfgTabIndex, $sfgFieldNum, $sfgJSValidationCalls;
@@ -1790,7 +1791,7 @@
17911792 if (! array_key_exists('rows', $other_args))
17921793 $other_args['rows'] = 5;
17931794 if (! array_key_exists('cols', $other_args))
1794 - $other_args['cols'] = 70;
 1795+ $other_args['cols'] = 80;
17951796
17961797 // if it's an autocomplete, call the with-autocomplete function instead
17971798 $autocompletion_disabled = array_key_exists('autocomplete on', $other_args) && $other_args['autocomplete on'] == "";
@@ -1981,7 +1982,7 @@
19821983 // can show up here either as an array or a string, depending on
19831984 // whether it came from user input or a wiki page
19841985 if (is_array($cur_value)) {
1985 - $checked_str = ($cur_value[value] == 'on') ? ' checked="checked"' : "";
 1986+ $checked_str = (array_key_exists('value', $cur_value) && $cur_value[value] == 'on') ? ' checked="checked"' : "";
19861987 } else {
19871988 // default to false - no need to check if it matches a 'false' word
19881989 $vlc = strtolower(trim($cur_value));

Status & tagging log