Code Duplication    Length = 11-11 lines in 2 locations

modules/contact-form/grunion-contact-form.php 2 locations

@@ 2437-2447 (lines=11) @@
2434
			$r .= "\t\t<textarea name='" . esc_attr( $field_id ) . "' id='contact-form-comment-" . esc_attr( $field_id ) . "' rows='20' " . $field_class . $field_placeholder . " " . ( $field_required ? "required aria-required='true'" : "" ) . ">" . esc_textarea( $field_value ) . "</textarea>\n";
2435
			$r .= "\t</div>\n";
2436
			break;
2437
		case 'radio' :
2438
			$r .= "\t<div><label class='grunion-field-label" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n";
2439
			foreach ( $this->get_attribute( 'options' ) as $option ) {
2440
				$option = Grunion_Contact_Form_Plugin::strip_tags( $option );
2441
				$r .= "\t\t<label class='grunion-radio-label radio" . ( $this->is_error() ? ' form-error' : '' ) . "'>";
2442
				$r .= "<input type='radio' name='" . esc_attr( $field_id ) . "' value='" . esc_attr( $option ) . "' " . $field_class . checked( $option, $field_value, false ) . " " . ( $field_required ? "required aria-required='true'" : "" ) . "/> ";
2443
				$r .= esc_html( $option ) . "</label>\n";
2444
				$r .= "\t\t<div class='clear-form'></div>\n";
2445
			}
2446
			$r .= "\t\t</div>\n";
2447
			break;
2448
		case 'checkbox' :
2449
			$r .= "\t<div>\n";
2450
			$r .= "\t\t<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>\n";
@@ 2467-2477 (lines=11) @@
2464
			}
2465
			$r .= "\t\t</div>\n";
2466
			break;
2467
		case 'select' :
2468
			$r .= "\n<div>\n";
2469
			$r .= "\t\t<label for='" . esc_attr( $field_id ) . "' class='grunion-field-label select" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>'. $required_field_text . '</span>' : '' ) . "</label>\n";
2470
			$r .= "\t<select name='" . esc_attr( $field_id ) . "' id='" . esc_attr( $field_id ) . "' " . $field_class . ( $field_required ? "required aria-required='true'" : "" ) . ">\n";
2471
			foreach ( $this->get_attribute( 'options' ) as $option ) {
2472
				$option = Grunion_Contact_Form_Plugin::strip_tags( $option );
2473
				$r .= "\t\t<option" . selected( $option, $field_value, false ) . ">" . esc_html( $option ) . "</option>\n";
2474
			}
2475
			$r .= "\t</select>\n";
2476
			$r .= "\t</div>\n";
2477
			break;
2478
		case 'date' :
2479
			$r .= "\n<div>\n";
2480
			$r .= "\t\t<label for='" . esc_attr( $field_id ) . "' class='grunion-field-label " . esc_attr( $field_type ) . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n";