Code Duplication    Length = 16-16 lines in 2 locations

core/helpers/EEH_Form_Fields.helper.php 2 locations

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