Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 2014-2024 (lines=11) @@
2011
			$r .= "\t\t<textarea name='" . esc_attr( $field_id ) . "' id='contact-form-comment-" . esc_attr( $field_id ) . "' rows='20' " . $field_placeholder . " " . ( $field_required ? "required aria-required='true'" : "" ) . ">" . esc_textarea( $field_value ) . "</textarea>\n";
2012
			$r .= "\t</div>\n";
2013
			break;
2014
		case 'radio' :
2015
			$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";
2016
			foreach ( $this->get_attribute( 'options' ) as $option ) {
2017
				$option = Grunion_Contact_Form_Plugin::strip_tags( $option );
2018
				$r .= "\t\t<label class='grunion-radio-label radio" . ( $this->is_error() ? ' form-error' : '' ) . "'>";
2019
				$r .= "<input type='radio' name='" . esc_attr( $field_id ) . "' value='" . esc_attr( $option ) . "' class='radio' " . checked( $option, $field_value, false ) . " " . ( $field_required ? "required aria-required='true'" : "" ) . "/> ";
2020
				$r .= esc_html( $option ) . "</label>\n";
2021
				$r .= "\t\t<div class='clear-form'></div>\n";
2022
			}
2023
			$r .= "\t\t</div>\n";
2024
			break;
2025
		case 'checkbox' :
2026
			$r .= "\t<div>\n";
2027
			$r .= "\t\t<label class='grunion-field-label checkbox" . ( $this->is_error() ? ' form-error' : '' ) . "'>\n";
@@ 2044-2054 (lines=11) @@
2041
			}
2042
			$r .= "\t\t</div>\n";
2043
			break;
2044
		case 'select' :
2045
			$r .= "\n<div>\n";
2046
			$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";
2047
			$r .= "\t<select name='" . esc_attr( $field_id ) . "' id='" . esc_attr( $field_id ) . "' class='select' " . ( $field_required ? "required aria-required='true'" : "" ) . ">\n";
2048
			foreach ( $this->get_attribute( 'options' ) as $option ) {
2049
				$option = Grunion_Contact_Form_Plugin::strip_tags( $option );
2050
				$r .= "\t\t<option" . selected( $option, $field_value, false ) . ">" . esc_html( $option ) . "</option>\n";
2051
			}
2052
			$r .= "\t</select>\n";
2053
			$r .= "\t</div>\n";
2054
			break;
2055
		case 'date' :
2056
			$r .= "\n<div>\n";
2057
			$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";