r78130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78129‎ | r78130 | r78131 >
Date:18:19, 9 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Overhaul of this file:
- Handling for "show on select" was greatly simplified - instead of creating direct JavaScript calls, the form inputs now just save the bare minimum amount of information for the Javascript (in SemanticForms.js) to handle "show on select" stuff on its own.
- Removed all Javascript-based validation - validation is now handled by SemanticForms.js, via the HTML classes.
- Rearranged some of the input HTML, given the new validation handling.
- Also removed global variables for combo boxes, FancyBox and autoGrow - unnecessary, since all are done via classes.
- Removed now-unnecessary extra autocompletion div, used only for YUI.
- Inputs no longer return Javascript at all, just HTML.
- Removed some more hardcoded HTML in favor of using the 'Xml' class.
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormInputs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.php
@@ -44,12 +44,10 @@
4545
4646 class SFTextInput extends SFFormInput {
4747 static function uploadLinkHTML( $input_id, $delimiter = null, $default_filename = null ) {
48 - global $wgOut, $sfgScriptPath, $sfgFancyBoxInputs;
 48+ global $wgOut, $sfgScriptPath;
4949
5050 $upload_window_page = SpecialPage::getPage( 'UploadWindow' );
5151 $query_string = "sfInputID=$input_id";
52 - $fancybox_id = "fancybox_$input_id";
53 - $sfgFancyBoxInputs[] = $input_id;
5452 if ( $delimiter != null )
5553 $query_string .= "&sfDelimiter=$delimiter";
5654 if ( $default_filename != null )
@@ -62,7 +60,13 @@
6361 else
6462 $style = '';
6563
66 - $text = " <a id=\"$fancybox_id\" href=\"$upload_window_url\" title=\"$upload_label\" rev=\"$style\">$upload_label</a>";
 64+ $linkAttrs = array(
 65+ 'href' => $upload_window_url,
 66+ 'class' => 'sfFancyBox',
 67+ 'title' => $upload_label,
 68+ 'rev' => $style
 69+ );
 70+ $text = "\t" . Xml::element( 'a', $linkAttrs, $upload_label ) . "\n";
6771 return $text;
6872 }
6973
@@ -76,59 +80,52 @@
7781 if ( array_key_exists( 'possible_values', $other_args ) && $other_args['possible_values'] != null )
7882 return SFDropdownInput::getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args );
7983
80 - global $sfgTabIndex, $sfgFieldNum, $sfgJSValidationCalls;
 84+ global $sfgTabIndex, $sfgFieldNum;
8185
82 - $className = ( $is_mandatory ) ? "createboxInput mandatoryField" : "createboxInput";
83 - if ( array_key_exists( 'class', $other_args ) )
 86+ $className = "createboxInput";
 87+ if ( $is_mandatory ) {
 88+ $className .= " mandatoryField";
 89+ }
 90+ if ( array_key_exists( 'class', $other_args ) ) {
8491 $className .= " " . $other_args['class'];
 92+ }
8593 $input_id = "input_$sfgFieldNum";
86 - $info_id = "info_$sfgFieldNum";
8794 // set size based on pre-set size, or field type - if field type is set,
8895 // possibly add validation too
89 - if ( array_key_exists( 'size', $other_args ) ) {
90 - $size = $other_args['size'];
91 - } elseif ( array_key_exists( 'field_type', $other_args ) ) {
92 - $validation_type_str = "";
93 - if ( $other_args['field_type'] == 'integer' ) {
 96+ $size = 35;
 97+ if ( array_key_exists( 'field_type', $other_args ) ) {
 98+ if ( $other_args['field_type'] == 'number' ) {
9499 $size = 10;
95 - $validation_type_str = 'integer';
96 - } elseif ( $other_args['field_type'] == 'number' ) {
97 - $size = 10;
98 - $validation_type_str = 'number';
 100+ $inputType = 'number';
99101 } elseif ( $other_args['field_type'] == 'URL' ) {
100102 $size = 100;
101 - $validation_type_str = 'URL';
 103+ $inputType = 'URL';
102104 } elseif ( $other_args['field_type'] == 'email' ) {
103105 $size = 45;
104 - $validation_type_str = 'email';
105 - } else {
106 - $size = 35;
 106+ $inputType = 'email';
107107 }
108 - if ( $validation_type_str != '' ) {
109 - if ( array_key_exists( 'part_of_multiple', $other_args ) ) {
110 - $sfgJSValidationCalls[] = "validate_type_of_multiple_fields($sfgFieldNum, '$validation_type_str')";
111 - } else {
112 - $sfgJSValidationCalls[] = "validate_field_type('$input_id', '$validation_type_str', '$info_id')";
113 - }
114 - }
115 - } else {
116 - $size = 35;
117108 }
118 - if ( ! is_null( $cur_value ) && ! is_array( $cur_value ) )
119 - $cur_value = htmlspecialchars( $cur_value );
 109+ if ( array_key_exists( 'size', $other_args ) ) {
 110+ $size = $other_args['size'];
 111+ }
120112
121 - $text = <<<END
122 - <input id="$input_id" tabindex="$sfgTabIndex" class="$className" name="$input_name" type="text" value="$cur_value" size="$size"
123 -END;
124 - if ( $is_disabled )
125 - $text .= " disabled";
126 - if ( array_key_exists( 'maxlength', $other_args ) )
127 - $text .= ' maxlength="' . $other_args['maxlength'] . '"';
128 - $text .= <<<END
129 -/>
130 - <span id="$info_id" class="errorMessage"></span>
 113+ $inputAttrs = array(
 114+ 'type' => 'text',
 115+ 'id' => $input_id,
 116+ 'tabindex' => $sfgTabIndex,
 117+ 'class' => $className,
 118+ 'name' => $input_name,
 119+ 'value' => $cur_value,
 120+ 'size' => $size
 121+ );
 122+ if ( $is_disabled ) {
 123+ $inputAttrs['disabled'] = 'disabled';
 124+ }
 125+ if ( array_key_exists( 'maxlength', $other_args ) ) {
 126+ $inputAttrs['maxlength'] = $other_args['maxlength'];
 127+ }
 128+ $text = Xml::element( 'input', $inputAttrs );
131129
132 -END;
133130 if ( array_key_exists( 'is_uploadable', $other_args ) && $other_args['is_uploadable'] == true ) {
134131 if ( array_key_exists( 'is_list', $other_args ) && $other_args['is_list'] == true ) {
135132 if ( array_key_exists( 'delimiter', $other_args ) ) {
@@ -146,7 +143,11 @@
147144 }
148145 $text .= self::uploadLinkHTML( $input_id, $delimiter, $default_filename );
149146 }
150 - return array( $text, null );
 147+ $spanClass = "inputSpan";
 148+ $spanClass .= " {$inputType}Input";
 149+ if ( $is_mandatory ) { $spanClass .= " mandatoryFieldSpan"; }
 150+ $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text );
 151+ return $text;
151152 }
152153
153154 public static function getParameters() {
@@ -161,69 +162,67 @@
162163
163164 class SFDropdownInput extends SFEnumInput {
164165 static function getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
165 - global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelectCalls;
 166+ global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelect;
166167
167168 $className = ( $is_mandatory ) ? "mandatoryField" : "createboxInput";
168169 if ( array_key_exists( 'class', $other_args ) )
169170 $className .= " " . $other_args['class'];
170171 $input_id = "input_$sfgFieldNum";
171 - $info_id = "info_$sfgFieldNum";
172 - $disabled_text = ( $is_disabled ) ? "disabled" : "";
173172 if ( array_key_exists( 'show on select', $other_args ) ) {
 173+ $className .= " sfShowIfSelected";
174174 foreach ( $other_args['show on select'] as $div_id => $options ) {
175 - $options_str = implode( "', '", $options );
176 - $js_text = "showIfSelected('$input_id', ['$options_str'], '$div_id'); ";
177 - $sfgShowOnSelectCalls[] = "jQuery('#$input_id').change( function() { $js_text } );";
178 - $sfgShowOnSelectCalls[] = $js_text;
 175+ if ( array_key_exists( $input_id, $sfgShowOnSelect ) ) {
 176+ $sfgShowOnSelect[$input_id][] = array( $options, $div_id );
 177+ } else {
 178+ $sfgShowOnSelect[$input_id] = array( array( $options, $div_id ) );
 179+ }
179180 }
180181 }
181 - $text = <<<END
182 - <select id="$input_id" tabindex="$sfgTabIndex" name="$input_name" class="$className" $disabled_text>
183 -
184 -END;
 182+ $innerDropdown = "";
185183 // add a blank value at the beginning, unless this is a mandatory field
186184 // and there's a current value in place (either through a default value
187185 // or because we're editing an existing page)
188186 if ( ! $is_mandatory || $cur_value == '' ) {
189 - $text .= " <option value=\"\"></option>\n";
 187+ $innerDropdown .= " <option value=\"\"></option>\n";
190188 }
191189 if ( ( $possible_values = $other_args['possible_values'] ) == null )
192190 $possible_values = array();
193191 foreach ( $possible_values as $possible_value ) {
194 - $text .= " <option value=\"$possible_value\"";
195 - if ( $possible_value == $cur_value ) { $text .= " selected=\"selected\""; }
196 - $text .= ">";
 192+ $optionAttrs = array( 'value' => $possible_value );
 193+ if ( $possible_value == $cur_value ) {
 194+ $optionAttrs['selected'] = "selected";
 195+ }
197196 if ( array_key_exists( 'value_labels', $other_args ) && is_array( $other_args['value_labels'] ) && array_key_exists( $possible_value, $other_args['value_labels'] ) )
198 - $text .= htmlspecialchars( $other_args['value_labels'][$possible_value] );
 197+ $label = $other_args['value_labels'][$possible_value];
199198 else
200 - $text .= $possible_value;
201 - $text .= "</option>\n";
 199+ $label = $possible_value;
 200+ $innerDropdown .= Xml::element( 'option', $optionAttrs, $label );
202201 }
203 - $text .= <<<END
204 - </select>
205 - <span id="$info_id" class="errorMessage"></span>
206 -
207 -END;
208 - return array( $text, null );
 202+ $selectAttrs = array(
 203+ 'id' => $input_id,
 204+ 'tabindex' => $sfgTabIndex,
 205+ 'name' => $input_name,
 206+ 'class' => $className
 207+ );
 208+ if ( $is_disabled ) {
 209+ $selectAttrs['disabled'] = 'disabled';
 210+ }
 211+ $text = Xml::tags( 'select', $selectAttrs, $innerDropdown );
 212+ $spanClass = "inputSpan";
 213+ if ( $is_mandatory ) { $spanClass .= " mandatoryFieldSpan"; }
 214+ $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text );
 215+ return $text;
209216 }
210217 }
211218
212219 class SFListBoxInput extends SFMultiEnumInput {
213220 static function getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
214 - global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelectCalls;
 221+ global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelect;
215222
216223 $className = ( $is_mandatory ) ? "mandatoryField" : "createboxInput";
217224 if ( array_key_exists( 'class', $other_args ) )
218225 $className .= " " . $other_args['class'];
219226 $input_id = "input_$sfgFieldNum";
220 - $info_id = "info_$sfgFieldNum";
221 - $hidden_input_name = $input_name . "[is_list]";
222 - $input_name .= "[]"; // needed so that this input will send an array
223 - if ( array_key_exists( 'size', $other_args ) )
224 - $size_text = "size=" . $other_args['size'];
225 - else
226 - $size_text = "";
227 - $disabled_text = ( $is_disabled ) ? "disabled" : "";
228227 // get list delimiter - default is comma
229228 if ( array_key_exists( 'delimiter', $other_args ) ) {
230229 $delimiter = $other_args['delimiter'];
@@ -231,68 +230,67 @@
232231 $delimiter = ",";
233232 }
234233 $cur_values = SFUtils::getValuesArray( $cur_value, $delimiter );
 234+ $className .= " sfShowIfSelected";
235235
236 - $text = <<<END
237 - <select id="$input_id" tabindex="$sfgTabIndex" name="$input_name" class="$className" multiple $size_text $disabled_text>
238 -
239 -END;
240236 if ( ( $possible_values = $other_args['possible_values'] ) == null )
241237 $possible_values = array();
242 - $enum_input_ids = array();
 238+ $optionsText = "";
243239 foreach ( $possible_values as $possible_value ) {
244 - // create array $enum_input_ids to associate values with their input IDs,
245 - // for use in creating the 'show on select' Javascript later
246 - $enum_input_ids[$possible_value] = $input_id;
247 - $text .= " <option value=\"$possible_value\"";
248 - if ( in_array( $possible_value, $cur_values ) ) { $text .= " selected"; }
249 - $text .= ">";
250240 if ( array_key_exists( 'value_labels', $other_args ) && is_array( $other_args['value_labels'] ) && array_key_exists( $possible_value, $other_args['value_labels'] ) )
251 - $text .= htmlspecialchars( $other_args['value_labels'][$possible_value] );
 241+ $optionLabel = $other_args['value_labels'][$possible_value];
252242 else
253 - $text .= $possible_value;
254 - $text .= "</option>\n";
 243+ $optionLabel = $possible_value;
 244+ $optionAttrs = array( 'value' => $possible_value );
 245+ if ( in_array( $possible_value, $cur_values ) ) {
 246+ $optionAttrs['selected'] = 'selected';
 247+ }
 248+ $optionsText .= Xml::element( 'option', $optionAttrs, $optionLabel );
255249 }
256 - $text .= <<<END
257 - </select>
258 - <span id="$info_id" class="errorMessage"></span>
259 - <input type="hidden" name="$hidden_input_name" value="1" />
 250+ $selectAttrs = array(
 251+ 'id' => $input_id,
 252+ 'tabindex' => $sfgTabIndex,
 253+ 'name' => $input_name . '[]',
 254+ 'class' => $className,
 255+ 'multiple' => 'multiple'
 256+ );
 257+ if ( array_key_exists( 'size', $other_args ) ) {
 258+ $selectAttrs['size'] = $other_args['size'];
 259+ }
 260+ if ( $is_disabled ) {
 261+ $selectAttrs['disabled'] = 'disabled';
 262+ }
 263+ $text = Xml::tags( 'select', $selectAttrs, $optionsText );
 264+ $hiddenInputAttrs = array(
 265+ 'value' => 1,
 266+ );
 267+ $text .= "\t" . Xml::hidden( $input_name . '[is_list]', $hiddenInputAttrs ) . "\n";
 268+ if ( $is_mandatory ) {
 269+ $text = Xml::tags( 'span', array( 'class' => 'inputSpan mandatoryFieldSpan' ), $text );
 270+ }
260271
261 -END;
262 -
263272 if ( array_key_exists( 'show on select', $other_args ) ) {
264273 foreach ( $other_args['show on select'] as $div_id => $options ) {
265 - $cur_input_ids = array();
266 - foreach ( $options as $option ) {
267 - if ( array_key_exists( $option, $enum_input_ids ) ) {
268 - $cur_input_ids[] = $enum_input_ids[$option];
269 - }
 274+ if ( array_key_exists( $input_id, $sfgShowOnSelect ) ) {
 275+ $sfgShowOnSelect[$input_id][] = array( $options, $div_id );
 276+ } else {
 277+ $sfgShowOnSelect[$input_id] = array( array( $options, $div_id ) );
270278 }
271 - $options_str = "['" . implode( "', '", $options ) . "']";
272 - $js_text = "showIfSelectedInListBox('$input_id', $options_str, '$div_id'); ";
273 - $sfgShowOnSelectCalls[] = $js_text;
274 - foreach ( $possible_values as $key => $possible_value ) {
275 - $cur_input_id = $enum_input_ids[$possible_value];
276 - if ( in_array( $possible_value, $options ) ) {
277 - $sfgShowOnSelectCalls[] = "jQuery('#$cur_input_id').click( function() { $js_text } );";
278 - }
279 - }
280279 }
281280 }
282281
283 - return array( $text, null );
 282+ return $text;
284283 }
285284 }
286285
287286 class SFCheckboxesInput extends SFMultiEnumInput {
288287 static function getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
289 - global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelectCalls;
 288+ global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelect;
290289
291290 $checkbox_class = ( $is_mandatory ) ? "mandatoryField" : "createboxInput";
292291 $span_class = "checkboxSpan";
293292 if ( array_key_exists( 'class', $other_args ) )
294293 $span_class .= " " . $other_args['class'];
295294 $input_id = "input_$sfgFieldNum";
296 - $hidden_input_name = $input_name . "[is_list]";
297295 // get list delimiter - default is comma
298296 if ( array_key_exists( 'delimiter', $other_args ) ) {
299297 $delimiter = $other_args['delimiter'];
@@ -304,15 +302,11 @@
305303 if ( ( $possible_values = $other_args['possible_values'] ) == null )
306304 $possible_values = array();
307305 $text = "";
308 - $enum_input_ids = array();
309306 foreach ( $possible_values as $key => $possible_value ) {
310 - // create array $enum_input_ids to associate values with their input IDs,
311 - // for use in creating the 'show on select' Javascript later
312 - $enum_input_ids[$possible_value] = $input_id;
313307 $cur_input_name = $input_name . "[" . $key . "]";
314308
315309 if ( array_key_exists( 'value_labels', $other_args ) && is_array( $other_args['value_labels'] ) && array_key_exists( $possible_value, $other_args['value_labels'] ) )
316 - $label = htmlspecialchars( $other_args['value_labels'][$possible_value] );
 310+ $label = $other_args['value_labels'][$possible_value];
317311 else
318312 $label = $possible_value;
319313
@@ -331,51 +325,38 @@
332326 $checkbox_attrs['disabled'] = 'disabled';
333327 }
334328 $checkbox_input = Xml::element( 'input', $checkbox_attrs );
 329+
 330+ // Make a span around each checkbox, for CSS purposes.
335331 $text .= ' ' . Xml::tags( 'span',
336332 array( 'class' => $span_class ),
337333 $checkbox_input . ' ' . $label
338334 ) . "\n";
339335 $sfgTabIndex++;
340336 $sfgFieldNum++;
341 - $input_id = "input_$sfgFieldNum";
342337 }
343 - // if it's mandatory, add a span around all the checkboxes, since
344 - // some browsers don't support formatting of checkboxes
 338+
 339+ $outerSpanID = "span_$sfgFieldNum";
 340+ $outerSpanClass = "checkboxesSpan";
345341 if ( $is_mandatory ) {
346 - $text = ' ' . Xml::tags( 'span',
347 - array(
348 - 'id' => $input_id,
349 - 'class' => 'mandatoryFieldsSpan',
350 - ), $text ) . "\n";
 342+ $outerSpanClass .= " mandatoryFieldSpan";
351343 }
352 - $info_id = "info_$sfgFieldNum";
353 - $text .= <<<END
354 - <span id="$info_id" class="errorMessage"></span>
355 - <input type="hidden" name="$hidden_input_name" value="1" />
356344
357 -END;
358 -
359345 if ( array_key_exists( 'show on select', $other_args ) ) {
 346+ $outerSpanClass .= " sfShowIfChecked";
360347 foreach ( $other_args['show on select'] as $div_id => $options ) {
361 - $cur_input_ids = array();
362 - foreach ( $options as $option ) {
363 - if ( array_key_exists( $option, $enum_input_ids ) ) {
364 - $cur_input_ids[] = $enum_input_ids[$option];
365 - }
 348+ if ( array_key_exists( $outerSpanID, $sfgShowOnSelect ) ) {
 349+ $sfgShowOnSelect[$outerSpanID][] = array( $options, $div_id );
 350+ } else {
 351+ $sfgShowOnSelect[$outerSpanID] = array( array( $options, $div_id ) );
366352 }
367 - $options_str = "['" . implode( "', '", $cur_input_ids ) . "']";
368 - $js_text = "showIfChecked($options_str, '$div_id'); ";
369 - $sfgShowOnSelectCalls[] = $js_text;
370 - foreach ( $possible_values as $key => $possible_value ) {
371 - $cur_input_id = $enum_input_ids[$possible_value];
372 - if ( in_array( $possible_value, $options ) ) {
373 - $sfgShowOnSelectCalls[] = "jQuery('#$cur_input_id').click( function() { $js_text } );";
374 - }
375 - }
376353 }
377354 }
378355
379 - return array( $text, null );
 356+ $text .= "\t" . Xml::hidden( $input_name . '[is_list]', array( 'value' => 1 ) ) . "\n";
 357+ $outerSpanAttrs = array( 'id' => $outerSpanID, 'class' => $outerSpanClass );
 358+ $text = "\t" . Xml::tags( 'span', $outerSpanAttrs, $text ) . "\n";
 359+
 360+ return $text;
380361 }
381362 }
382363
@@ -392,14 +373,18 @@
393374
394375 global $sfgTabIndex, $sfgFieldNum, $wgOut, $sfgScriptPath, $wgJsMimeType;
395376 global $smwgScriptPath, $smwgJqUIAutoIncluded;
396 - global $sfgAutocompleteMappings, $sfgComboBoxInputs, $sfgAutogrowInputs;
 377+ global $sfgAutocompleteMappings;
397378
398379 $autocomplete_field_type = "";
399380 $autocompletion_source = "";
400381
401 - $className = ( $is_mandatory ) ? "autocompleteInput mandatoryField" : "autocompleteInput createboxInput";
402 - if ( array_key_exists( 'class', $other_args ) )
 382+ $className = "sfComboBox";
 383+ if ( $is_mandatory ) {
 384+ $className .= " mandatoryField";
 385+ }
 386+ if ( array_key_exists( 'class', $other_args ) ) {
403387 $className .= " " . $other_args['class'];
 388+ }
404389 $disabled_text = ( $is_disabled ) ? "disabled" : "";
405390 if ( array_key_exists( 'autocomplete field type', $other_args ) ) {
406391 $autocomplete_field_type = $other_args['autocomplete field type'];
@@ -415,9 +400,7 @@
416401 $size = "35";
417402
418403 $input_id = "input_" . $sfgFieldNum;
419 - $info_id = "info_" . $sfgFieldNum;
420 - $div_name = "div_" . $sfgFieldNum;
421 -
 404+
422405 $options_str_key = str_replace( "'", "\'", $autocompletion_source );
423406 $sfgAutocompleteMappings[$sfgFieldNum] = $options_str_key;
424407
@@ -425,9 +408,11 @@
426409
427410 /*adding code for displaying dropdown of autocomplete values*/
428411
 412+ $divClass = "ui-widget";
 413+ if ($is_mandatory) { $divClass .= " mandatory"; }
429414 $text =<<<END
430 -<div class="ui-widget">
431 - <select id="input_$sfgFieldNum" name="$input_name" tabindex="$sfgTabIndex">
 415+<div class="$divClass">
 416+ <select id="input_$sfgFieldNum" name="$input_name" class="$className" tabindex="$sfgTabIndex">
432417 <option value="$cur_value"></option>
433418
434419 END;
@@ -436,10 +421,8 @@
437422 }
438423 $text .= <<<END
439424 </select>
440 - <span id="$info_id" class="errorMessage"></span>
441425 </div>
442426 END;
443 - $sfgComboBoxInputs[] = $sfgFieldNum;
444427 // there's no direct correspondence between the 'size=' attribute for
445428 // text inputs and the number of pixels, but multiplying by 6 seems to
446429 // be about right for the major browsers
@@ -450,7 +433,7 @@
451434 </style>
452435 END;
453436 $wgOut->addScript($combobox_css);
454 - return array( $text, null );
 437+ return $text;
455438 }
456439 }
457440
@@ -467,7 +450,7 @@
468451 return SFDropdownInput::getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args );
469452
470453 global $sfgTabIndex, $sfgFieldNum, $sfgScriptPath, $wgJsMimeType, $smwgScriptPath, $smwgJqUIAutoIncluded;
471 - global $sfgAutogrowInputs, $sfgAutocompleteMappings, $sfgAutocompleteDataTypes, $sfgAutocompleteValues;
 454+ global $sfgAutocompleteMappings, $sfgAutocompleteDataTypes, $sfgAutocompleteValues;
472455
473456 $className = ( $is_mandatory ) ? "autocompleteInput mandatoryField" : "autocompleteInput createboxInput";
474457 if ( array_key_exists( 'class', $other_args ) )
@@ -481,15 +464,12 @@
482465 }
483466 }
484467 $input_id = "input_" . $sfgFieldNum;
485 - $info_id = "info_" . $sfgFieldNum;
486 - $div_name = "div_" . $sfgFieldNum;
487468 if ( array_key_exists( 'input_type', $other_args ) && $other_args['input_type'] == "textarea" ) {
488469
489470 $rows = $other_args['rows'];
490471 $cols = $other_args['cols'];
491472 $text = "";
492473 if ( array_key_exists( 'autogrow', $other_args ) ) {
493 - $sfgAutogrowInputs[] = $input_id;
494474 $className .= ' autoGrow';
495475 if ( ! method_exists( 'OutputPage', 'addModules' ) ) {
496476 global $wgOut;
@@ -528,15 +508,22 @@
529509 else
530510 $size = "35";
531511
532 - $text = <<<END
533 - <input tabindex="$sfgTabIndex" id="$input_id" name="$input_name" type="text" value="" size="$size" class="$className"
534 -
535 -END;
536 - if ( $is_disabled )
537 - $text .= " disabled";
538 - if ( array_key_exists( 'maxlength', $other_args ) )
539 - $text .= ' maxlength="' . $other_args['maxlength'] . '"';
540 - $text .= "/>\n";
 512+ $inputAttrs = array(
 513+ 'type' => 'text',
 514+ 'id' => $input_id,
 515+ 'name' => $input_name,
 516+ 'value' => $cur_value,
 517+ 'size' => $size,
 518+ 'class' => $className,
 519+ 'tabindex' => $sfgTabIndex,
 520+ );
 521+ if ( $is_disabled ) {
 522+ $inputAttrs['disabled'] = 'disabled';
 523+ }
 524+ if ( array_key_exists( 'maxlength', $other_args ) ) {
 525+ $text .= ' maxlength="' . $other_args['maxlength'] . '"';
 526+ }
 527+ $text = "\t" . Xml::element( 'input', $inputAttrs ) . "\n";
541528 }
542529 // is_list and delimiter variables - needed later
543530 $is_list = ( array_key_exists( 'is_list', $other_args ) && $other_args['is_list'] == true );
@@ -557,11 +544,10 @@
558545 }
559546 $text .= self::uploadLinkHTML( $input_id, $delimiter, $default_filename );
560547 }
561 - $text .= <<<END
562 - <span id="$info_id" class="errorMessage"></span>
563 - <div class="page_name_auto_complete" id="$div_name"></div>
564548
565 -END;
 549+ $spanClass = "inputSpan";
 550+ if ( $is_mandatory ) { $spanClass .= " mandatoryFieldSpan"; }
 551+ $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text );
566552
567553 $options_str_key = $autocompletion_source;
568554 if ( $is_list ) {
@@ -578,19 +564,7 @@
579565 $autocomplete_values = SFUtils::getAutocompleteValues( $autocompletion_source, $autocomplete_field_type );
580566 $sfgAutocompleteValues[$options_str_key] = $autocomplete_values;
581567 }
582 - if ( $cur_value ) {
583 - // replace various values to not break the Javascript
584 - $cur_value = str_replace( '"', '\"', $cur_value );
585 - $cur_value = str_replace( "\n", '\n', $cur_value );
586 - $cur_value = str_replace( "\r", '\r', $cur_value );
587 - $text .= <<<END
588 - <script type="text/javascript">/* <![CDATA[ */
589 - document.getElementById('$input_id').value = "$cur_value"
590 - /* ]]> */</script>
591 -
592 -END;
593 - }
594 - return array( $text, null );
 568+ return $text;
595569 }
596570
597571 public static function getParameters() {
@@ -617,21 +591,18 @@
618592 return SFTextWithAutocompleteInput::getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args );
619593 }
620594
621 - global $sfgTabIndex, $sfgFieldNum, $smwgScriptPath, $sfgScriptPath, $sfgAutogrowInputs;
 595+ global $sfgTabIndex, $sfgFieldNum, $smwgScriptPath, $sfgScriptPath;
622596
623597 $className = ( $is_mandatory ) ? "mandatoryField" : "createboxInput";
624598 if ( array_key_exists( 'class', $other_args ) )
625599 $className .= " " . $other_args['class'];
626 - $info_id = "info_$sfgFieldNum";
627600 // use a special ID for the free text field, for FCK's needs
628601 $input_id = $input_name == "free_text" ? "free_text" : "input_$sfgFieldNum";
629602
630603 $rows = $other_args['rows'];
631604 $cols = $other_args['cols'];
632605
633 - $text = "";
634606 if ( array_key_exists( 'autogrow', $other_args ) ) {
635 - $sfgAutogrowInputs[] = $input_id;
636607 $className .= ' autoGrow';
637608 if ( ! method_exists( 'OutputPage', 'addModules' ) ) {
638609 global $wgOut;
@@ -662,13 +633,11 @@
663634 $textarea_attrs['onKeyDown'] = $maxLengthJSCheck;
664635 $textarea_attrs['onKeyUp'] = $maxLengthJSCheck;
665636 }
666 - $textarea_input = Xml::element( 'textarea', $textarea_attrs, $cur_value, false );
667 - $text .= <<<END
668 - $textarea_input
669 - <span id="$info_id" class="errorMessage"></span>
670 -
671 -END;
672 - return array( $text, null );
 637+ $text = Xml::element( 'textarea', $textarea_attrs, $cur_value, false );
 638+ $spanClass = "inputSpan";
 639+ if ( $is_mandatory ) { $spanClass .= " mandatoryFieldSpan"; }
 640+ $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text );
 641+ return $text;
673642 }
674643
675644 public static function getParameters() {
@@ -682,33 +651,35 @@
683652
684653 class SFDateInput extends SFFormInput {
685654 static function monthDropdownHTML( $cur_month, $input_name, $is_disabled ) {
686 - global $sfgTabIndex, $sfgFieldNum, $wgAmericanDates;
 655+ global $sfgTabIndex, $wgAmericanDates;
687656
688 - $disabled_text = ( $is_disabled ) ? "disabled" : "";
689 - $text = ' <select tabindex="' . $sfgTabIndex . '" id="input_' . $sfgFieldNum . '_month" name="' . $input_name . "[month]\" $disabled_text>\n";
 657+ $optionsText = "";
690658 $month_names = SFFormUtils::getMonthNames();
691659 foreach ( $month_names as $i => $name ) {
692660 // pad out month to always be two digits
693661 $month_value = ( $wgAmericanDates == true ) ? $name : str_pad( $i + 1, 2, "0", STR_PAD_LEFT );
694 - $text .= " <option value=\"$month_value\"";
695 - if ( $name == $cur_month || ( $i + 1 ) == $cur_month ) { $text .= " selected=\"selected\""; }
696 - $text .= ">$name</option>\n";
 662+ $optionAttrs = array ( 'value' => $month_value );
 663+ if ( $name == $cur_month || ( $i + 1 ) == $cur_month ) {
 664+ $optionAttrs['selected'] = 'selected';
 665+ }
 666+ $optionsText .= Xml::element( 'option', $optionAttrs, $name );
697667 }
698 - $text .= " </select>\n";
 668+ $selectAttrs = array(
 669+ 'class' => 'monthInput',
 670+ 'name' => $input_name . '[month]',
 671+ 'tabindex' => $sfgTabIndex
 672+ );
 673+ if ( $is_disabled ) {
 674+ $selectAttrs['disabled'] = 'disabled';
 675+ }
 676+ $text = Xml::tags( 'select', $selectAttrs, $optionsText );
699677 return $text;
700678 }
701679
702 - static function getText( $date, $input_name, $is_mandatory, $is_disabled, $other_args ) {
703 - global $sfgTabIndex, $sfgFieldNum, $sfgJSValidationCalls, $wgAmericanDates;
 680+ static function getMainHTML( $date, $input_name, $is_mandatory, $is_disabled, $other_args ) {
 681+ global $sfgTabIndex, $sfgFieldNum, $wgAmericanDates;
704682
705683 $input_id = "input_$sfgFieldNum";
706 - $info_id = "info_$sfgFieldNum";
707 - // add to validation calls
708 - if ( array_key_exists( 'part_of_multiple', $other_args ) ) {
709 - $sfgJSValidationCalls[] = "validate_type_of_multiple_fields($sfgFieldNum, 'date')";
710 - } else {
711 - $sfgJSValidationCalls[] = "validate_field_type('$input_id', 'date', '$info_id')";
712 - }
713684
714685 if ( $date ) {
715686 // can show up here either as an array or a string, depending on
@@ -737,17 +708,24 @@
738709 }
739710 $text = "";
740711 $disabled_text = ( $is_disabled ) ? "disabled" : "";
 712+ $monthInput = self::monthDropdownHTML( $month, $input_name, $is_disabled );
 713+ $dayInput = ' <input tabindex="' . $sfgTabIndex . '" class="dayInput" name="' . $input_name . '[day]" type="text" value="' . $day . '" size="2" ' . $disabled_text . '/>';
741714 if ( $wgAmericanDates ) {
742 - $text .= self::monthDropdownHTML( $month, $input_name, $is_disabled );
743 - $text .= ' <input tabindex="' . $sfgTabIndex . '" id="' . $input_id . '_day" name="' . $input_name . '[day]" type="text" value="' . $day . '" size="2" ' . $disabled_text . '/>' . "\n";
 715+ $text .= "$monthInput\n$dayInput\n";
744716 } else {
745 - $text .= ' <input tabindex="' . $sfgTabIndex . '" id="' . $input_id . '_day" name="' . $input_name . '[day]" type="text" value="' . $day . '" size="2" ' . $disabled_text . '/>' . "\n";
746 - $text .= self::monthDropdownHTML( $month, $input_name, $is_disabled );
 717+ $text .= "$dayInput\n$monthInput\n";
747718 }
748 - $text .= ' <input tabindex="' . $sfgTabIndex . '" id="' . $input_id . '_year" name="' . $input_name . '[year]" type="text" value="' . $year . '" size="4" ' . $disabled_text . '/>' . "\n";
749 - $text .= " <span id=\"$info_id\" class=\"errorMessage\"></span>";
750 - return array( $text, null );
 719+ $text .= ' <input tabindex="' . $sfgTabIndex . '" class="yearInput" name="' . $input_name . '[year]" type="text" value="' . $year . '" size="4" ' . $disabled_text . '/>' . "\n";
 720+ return $text;
751721 }
 722+
 723+ static function getText( $date, $input_name, $is_mandatory, $is_disabled, $other_args ) {
 724+ $text = self::getMainHTML( $date, $input_name, $is_mandatory, $is_disabled, $other_args );
 725+ $spanClass = "dateInput";
 726+ if ( $is_mandatory ) { $spanClass .= " mandatoryFieldSpan"; }
 727+ $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text );
 728+ return $text;
 729+ }
752730 }
753731
754732 class SFDateTimeInput extends SFDateInput {
@@ -792,7 +770,7 @@
793771 $timezone = "";
794772 }
795773
796 - list( $text, $javascript_text ) = parent::getText( $datetime, $input_name, $is_mandatory, $is_disabled, $other_args );
 774+ $text = parent::getMainHTML( $datetime, $input_name, $is_mandatory, $is_disabled, $other_args );
797775 $disabled_text = ( $is_disabled ) ? "disabled" : "";
798776 $text .= ' &#160;<input tabindex="' . $sfgTabIndex . '" name="' . $input_name . '[hour]" type="text" value="' . $hour . '" size="2"/ ' . $disabled_text . '>';
799777 $sfgTabIndex++;
@@ -817,38 +795,22 @@
818796 $text .= ' <input tabindex="' . $sfgTabIndex . '" name="' . $input_name . '[timezone]" type="text" value="' . $timezone . '" size="2"/ ' . $disabled_text . '>' . "\n";
819797 }
820798
821 - return array( $text, null );
 799+ return $text;
822800 }
823801 }
824802
825803 class SFRadioButtonInput extends SFEnumInput {
826804 static function getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
827 - global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelectCalls;
 805+ global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelect;
828806
829 - $span_class = "checkboxSpan";
830 - if ( array_key_exists( 'class', $other_args ) )
831 - $span_class .= " " . $other_args['class'];
832 -
833 - $check_set = false;
834 - $text = "";
835 - // if it's mandatory, add a span around all the radiobuttons, since
836 - // some browsers don't support formatting of radiobuttons
837 - if ( $is_mandatory )
838 - $text .= ' <span class="mandatoryFieldsSpan">' . "\n";
839 -
840807 if ( ( $possible_values = $other_args['possible_values'] ) == null )
841808 $possible_values = array();
842809
843 - // Add a "None" value, unless this is a mandatory field and there's a
844 - // current value in place (either through a default value or because
845 - // we're editing an existing page).
846 - // We place it at the end of the array, instead of the beginning (even
847 - // though it gets displayed at the beginning) so that the "None" value's
848 - // ID will match that of the "error message" span, which is created at
849 - // the end of the process - the validation Javascript requires that the
850 - // two be matching
 810+ // Add a "None" value at the beginning, unless this is a mandatory
 811+ // field and there's a current value in place (either through a
 812+ // default value or because we're editing an existing page).
851813 if ( ! $is_mandatory || $cur_value == '' ) {
852 - $possible_values[] = '';
 814+ array_unshift( $possible_values, '' );
853815 }
854816
855817 // Set $cur_value to be one of the allowed options, if it isn't already -
@@ -861,18 +823,12 @@
862824 $cur_value = $possible_values[0];
863825 }
864826
865 - $enum_input_ids = array();
866 - $radiobuttons_text = '';
867 - $none_radiobutton_text = '';
 827+ $text = '';
868828 foreach ( $possible_values as $i => $possible_value ) {
869829 $sfgTabIndex++;
870830 $sfgFieldNum++;
871831 $input_id = "input_$sfgFieldNum";
872832
873 - // create array $enum_input_ids to associate values with their input IDs,
874 - // for use in creating the 'show on select' Javascript later
875 - $enum_input_ids[$possible_value] = $input_id;
876 -
877833 $radiobutton_attrs = array(
878834 'type' => 'radio',
879835 'id' => $input_id,
@@ -893,77 +849,53 @@
894850 else
895851 $label = $possible_value;
896852
897 - $radiobutton_text = ' ' .
898 - Xml::element ( 'input', $radiobutton_attrs ) . " $label\n";
 853+ $text .= "\t" . Xml::element ( 'input', $radiobutton_attrs ) . " $label\n";
 854+ }
899855
900 - // There's special handling for the "None" radiobutton, if it exists,
901 - // because it's created last but displayed first - see above.
902 - if ( $possible_value == '' ) {
903 - $none_radiobutton_text = $radiobutton_text;
904 - } else {
905 - $radiobuttons_text .= $radiobutton_text;
906 - }
 856+ $spanClass = "radioButtonSpan";
 857+ if ( array_key_exists( 'class', $other_args ) ) {
 858+ $spanClass .= " " . $other_args['class'];
907859 }
908 - $text = $none_radiobutton_text . $radiobuttons_text;
 860+ if ( $is_mandatory ) {
 861+ $spanClass .= " mandatoryFieldSpan";
 862+ }
909863
910 - // close span
911 - if ( $is_mandatory )
912 - $text .= " </span>";
913 - $info_id = "info_$sfgFieldNum";
914 - $text .= <<<END
915 - <span id="$info_id" class="errorMessage"></span>
 864+ $spanID = "span_$sfgFieldNum";
916865
917 -END;
918 -
919 - // Finally, we do the 'show on select' handling.
 866+ // Do the 'show on select' handling.
920867 if ( array_key_exists( 'show on select', $other_args ) ) {
 868+ $spanClass .= " sfShowIfChecked";
921869 foreach ( $other_args['show on select'] as $div_id => $options ) {
922 - $cur_input_ids = array();
923 - foreach ( $options as $option ) {
924 - if ( array_key_exists( $option, $enum_input_ids ) ) {
925 - $cur_input_ids[] = $enum_input_ids[$option];
926 - }
 870+ if ( array_key_exists( $spanID, $sfgShowOnSelect ) ) {
 871+ $sfgShowOnSelect[$spanID][] = array( $options, $div_id );
 872+ } else {
 873+ $sfgShowOnSelect[$spanID] = array( array( $options, $div_id ) );
927874 }
928 - // If there were no matches to existing radiobutton options, escape
929 - if ( count( $cur_input_ids ) == 0 ) {
930 - continue;
931 - }
932 - $options_str = "['" . implode( "', '", $cur_input_ids ) . "']";
933 - $js_text = "showIfChecked($options_str, '$div_id');";
934 - $sfgShowOnSelectCalls[] = $js_text;
935 - foreach ( $possible_values as $key => $possible_value ) {
936 - // We need to add each click handler to each radiobutton,
937 - // because there doesn't seem to be any way for a radiobutton
938 - // to know that it was unchecked - rather, the newly-checked
939 - // radiobutton has to handle the change.
940 - foreach ( $enum_input_ids as $cur_input_id ) {
941 - if ( in_array( $possible_value, $options ) ) {
942 - $sfgShowOnSelectCalls[] = "jQuery('#$cur_input_id').click( function() { $js_text } );";
943 - }
944 - }
945 - }
946875 }
947876 }
 877+ $spanAttrs = array(
 878+ 'id' => $spanID,
 879+ 'class' => $spanClass
 880+ );
 881+ $text = Xml::tags( 'span', $spanAttrs, $text );
948882
949 - return array( $text, null );
 883+ return $text;
950884 }
951885 }
952886
953887 class SFCheckboxInput extends SFFormInput {
954888 static function getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
955 - global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelectCalls;
 889+ global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelect;
956890
957891 $className = ( $is_mandatory ) ? "mandatoryField" : "createboxInput";
958892 if ( array_key_exists( 'class', $other_args ) )
959893 $className .= " " . $other_args['class'];
960 - $info_id = "info_$sfgFieldNum";
961894 $input_id = "input_$sfgFieldNum";
962895 $disabled_text = ( $is_disabled ) ? "disabled" : "";
963896 if ( array_key_exists( 'show on select', $other_args ) ) {
 897+ $className .= " sfShowIfCheckedCheckbox";
964898 $div_id = key( $other_args['show on select'] );
965 - $js_text = "showIfChecked(['$input_id'], '$div_id');";
966 - $sfgShowOnSelectCalls[] = $js_text;
967 - $sfgShowOnSelectCalls[] = "jQuery('#$input_id').click( function() { $js_text } );";
 899+ $sfgShowOnSelect[$input_id] = $div_id;
968900 }
969901
970902 // can show up here either as an array or a string, depending on
@@ -984,10 +916,9 @@
985917 $text = <<<END
986918 <input name="{$input_name}[is_checkbox]" type="hidden" value="true" />
987919 <input id="$input_id" name="{$input_name}[value]" type="checkbox" class="$className" tabindex="$sfgTabIndex" $checked_str $disabled_text/>
988 - <span id="$info_id" class="errorMessage"></span>
989920
990921 END;
991 - return array( $text, null );
 922+ return $text;
992923 }
993924 }
994925
@@ -995,7 +926,7 @@
996927 static function getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
997928 // escape if CategoryTree extension isn't included
998929 if ( ! function_exists( 'efCategoryTreeParserHook' ) )
999 - return array( null, null );
 930+ return null;
1000931
1001932 global $sfgTabIndex, $sfgFieldNum;
1002933
@@ -1006,7 +937,7 @@
1007938 $top_category = $other_args['top category'];
1008939 } else {
1009940 // escape - we can't do anything
1010 - return array( null, null );
 941+ return null;
1011942 }
1012943 if ( array_key_exists( 'height', $other_args ) ) {
1013944 $height = $other_args['height'];
@@ -1018,8 +949,6 @@
1019950 } else {
1020951 $width = "500";
1021952 }
1022 - $input_id = "input_$sfgFieldNum";
1023 - $info_id = "info_$sfgFieldNum";
1024953
1025954 $text = '<div style="overflow: auto; padding: 5px; border: 1px #aaaaaa solid; max-height: ' . $height . 'px; width: ' . $width . 'px;">';
1026955
@@ -1027,9 +956,7 @@
1028957 // and there's a current value in place (either through a default value
1029958 // or because we're editing an existing page)
1030959 if ( ! $is_mandatory || $cur_value == '' ) {
1031 - $input_id = "input_$sfgFieldNum";
1032 - $info_id = "info_$sfgFieldNum";
1033 - $text .= ' <input type="radio" id="' . $input_id . '" tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value=""';
 960+ $text .= ' <input type="radio" tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value=""';
1034961 if ( ! $cur_value ) {
1035962 $text .= ' checked="checked"';
1036963 }
@@ -1048,7 +975,7 @@
1049976 $cur_value = $wgContLang->ucfirst( $cur_value );
1050977 }
1051978
1052 - $tree = preg_replace( '/(<a class="CategoryTreeLabel.*>)(.*)(<\/a>)/', '<input id="' . $input_id . '" tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value="$2" type="radio"> $1$2$3', $tree );
 979+ $tree = preg_replace( '/(<a class="CategoryTreeLabel.*>)(.*)(<\/a>)/', '<input tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value="$2" type="radio"> $1$2$3', $tree );
1053980 $tree = str_replace( "value=\"$cur_value\"", "value=\"$cur_value\" checked=\"checked\"", $tree );
1054981 // if it's disabled, set all to disabled
1055982 if ( $is_disabled ) {
@@ -1056,12 +983,11 @@
1057984 }
1058985 $text .= $tree . '</div>';
1059986
1060 - $text .= <<<END
1061 - <span id="$info_id" class="errorMessage"></span>
 987+ $spanClass = "radioButtonSpan";
 988+ if ( $is_mandatory) { $spanClass .= " mandatoryFieldSpan"; }
 989+ $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text );
1062990
1063 -END;
1064 -
1065 - return array( $text, null );
 991+ return $text;
1066992 }
1067993 }
1068994
@@ -1069,7 +995,7 @@
1070996 static function getText( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
1071997 // escape if CategoryTree extension isn't included
1072998 if ( ! function_exists( 'efCategoryTreeParserHook' ) )
1073 - return array( null, null );
 999+ return null;
10741000
10751001 global $sfgTabIndex, $sfgFieldNum, $wgCapitalLinks;
10761002
@@ -1078,7 +1004,6 @@
10791005 $className .= " " . $other_args['class'];
10801006 $input_id = "input_$sfgFieldNum";
10811007 $info_id = "info_$sfgFieldNum";
1082 - $hidden_input_name = $input_name . "[is_list]";
10831008 // get list delimiter - default is comma
10841009 if ( array_key_exists( 'delimiter', $other_args ) ) {
10851010 $delimiter = $other_args['delimiter'];
@@ -1090,7 +1015,7 @@
10911016 $top_category = $other_args['top category'];
10921017 } else {
10931018 // escape - we can't do anything
1094 - return array( null, null );
 1019+ return null;
10951020 }
10961021 if ( array_key_exists( 'height', $other_args ) ) {
10971022 $height = $other_args['height'];
@@ -1132,11 +1057,11 @@
11331058 }
11341059 $text = '<div style="overflow: auto; padding: 5px; border: 1px #aaaaaa solid; max-height: ' . $height . 'px; width: ' . $width . 'px;">' . $tree . '</div>';
11351060
1136 - $text .= <<<END
1137 - <input type="hidden" name="$hidden_input_name" value="1" />
 1061+ $text .= "\t" . Xml::hidden( $input_name . '[is_list]', array( 'value' => 1 ) ) . "\n";
 1062+ $spanClass = "checkboxesSpan";
 1063+ if ( $is_mandatory) { $spanClass .= " mandatoryFieldSpan"; }
 1064+ $text = "\t" . Xml::tags( 'span', array( 'class' => $spanClass ), $text ) . "\n";
11381065
1139 -END;
1140 -
1141 - return array( $text, null );
 1066+ return $text;
11421067 }
11431068 }

Status & tagging log