Code Duplication    Length = 16-16 lines in 2 locations

core/helpers/EEH_Form_Fields.helper.php 2 locations

@@ 269-284 (lines=16) @@
266
						$fld .= $extra_desc;
267
					break;
268
269
				case 'checkbox' :
270
						$c_input = '';
271
						if ( is_array($value) ) {
272
							foreach ( $value as $key => $val ) {
273
								$c_id = $field_name . '_' . $value;
274
								$c_class = isset($classes[$key]) ? ' class="' . $classes[$key] . '" ' : '';
275
								$c_label = isset($labels[$key]) ? '<label for="' . $c_id . '">' . $labels[$key] . '</label>' : '';
276
								$checked = !empty($default) && $default == $val ? ' checked="checked" ' : '';
277
								$c_input .= '<input name="' . $f_name . '[]" type="checkbox" id="' . $c_id . '"' . $c_class . 'value="' . $val . '"' . $checked . $tabindex_str . ' />' . "\n" . $c_label;
278
							}
279
							$fld = $c_input;
280
						} else {
281
							$checked = !empty($default) && $default == $val ? 'checked="checked" ' : '';
282
							$fld = '<input name="'. $f_name . '" type="checkbox" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $checked . $tabindex_str . ' />' . "\n";
283
						}
284
					break;
285
286
				case 'radio' :
287
						$c_input = '';
@@ 286-301 (lines=16) @@
283
						}
284
					break;
285
286
				case 'radio' :
287
						$c_input = '';
288
						if ( is_array($value) ) {
289
							foreach ( $value as $key => $val ) {
290
								$c_id = $field_name . '_' . $value;
291
								$c_class = isset($classes[$key]) ? 'class="' . $classes[$key] . '" ' : '';
292
								$c_label = isset($labels[$key]) ? '<label for="' . $c_id . '">' . $labels[$key] . '</label>' : '';
293
								$checked = !empty($default) && $default == $val ? ' checked="checked" ' : '';
294
								$c_input .= '<input name="' . $f_name . '" type="checkbox" id="' . $c_id . '"' . $c_class . 'value="' . $val . '"' . $checked . $tabindex_str . ' />' . "\n" . $c_label;
295
							}
296
							$fld = $c_input;
297
						} else {
298
							$checked = !empty($default) && $default == $val ? 'checked="checked" ' : '';
299
							$fld = '<input name="'. $f_name . '" type="checkbox" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $checked . $tabindex_str . ' />' . "\n";
300
						}
301
					break;
302
303
				case 'hidden' :
304
						$fld = '<input name="' . $f_name . '" type="hidden" id="' . $id . '" class="' . $class . '" value="' . $value . '" />' . "\n";