|
@@ 2612-2617 (lines=6) @@
|
| 2609 |
|
$required_field_text = esc_html( apply_filters( 'jetpack_required_field_text', __( '(required)', 'jetpack' ) ) ); |
| 2610 |
|
|
| 2611 |
|
switch ( $field_type ) { |
| 2612 |
|
case 'email' : |
| 2613 |
|
$r .= "\n<div>\n"; |
| 2614 |
|
$r .= "\t\t<label for='" . esc_attr( $field_id ) . "' class='grunion-field-label email" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n"; |
| 2615 |
|
$r .= "\t\t<input type='email' name='" . esc_attr( $field_id ) . "' id='" . esc_attr( $field_id ) . "' value='" . esc_attr( $field_value ) . "' " . $field_class . $field_placeholder . ' ' . ( $field_required ? "required aria-required='true'" : '' ) . "/>\n"; |
| 2616 |
|
$r .= "\t</div>\n"; |
| 2617 |
|
break; |
| 2618 |
|
case 'telephone' : |
| 2619 |
|
$r .= "\n<div>\n"; |
| 2620 |
|
$r .= "\t\t<label for='" . esc_attr( $field_id ) . "' class='grunion-field-label telephone" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n"; |
|
@@ 2623-2628 (lines=6) @@
|
| 2620 |
|
$r .= "\t\t<label for='" . esc_attr( $field_id ) . "' class='grunion-field-label telephone" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n"; |
| 2621 |
|
$r .= "\t\t<input type='tel' name='" . esc_attr( $field_id ) . "' id='" . esc_attr( $field_id ) . "' value='" . esc_attr( $field_value ) . "' " . $field_class . $field_placeholder . "/>\n"; |
| 2622 |
|
break; |
| 2623 |
|
case 'textarea' : |
| 2624 |
|
$r .= "\n<div>\n"; |
| 2625 |
|
$r .= "\t\t<label for='contact-form-comment-" . esc_attr( $field_id ) . "' class='grunion-field-label textarea" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n"; |
| 2626 |
|
$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"; |
| 2627 |
|
$r .= "\t</div>\n"; |
| 2628 |
|
break; |
| 2629 |
|
case 'radio' : |
| 2630 |
|
$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"; |
| 2631 |
|
foreach ( $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
|
@@ 2678-2684 (lines=7) @@
|
| 2675 |
|
|
| 2676 |
|
wp_enqueue_script( 'grunion-frontend', plugins_url( 'js/grunion-frontend.js', __FILE__ ), array( 'jquery', 'jquery-ui-datepicker' ) ); |
| 2677 |
|
break; |
| 2678 |
|
default : // text field |
| 2679 |
|
// note that any unknown types will produce a text input, so we can use arbitrary type names to handle |
| 2680 |
|
// input fields like name, email, url that require special validation or handling at POST |
| 2681 |
|
$r .= "\n<div>\n"; |
| 2682 |
|
$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"; |
| 2683 |
|
$r .= "\t\t<input type='text' name='" . esc_attr( $field_id ) . "' id='" . esc_attr( $field_id ) . "' value='" . esc_attr( $field_value ) . "' " . $field_class . $field_placeholder . ' ' . ( $field_required ? "required aria-required='true'" : '' ) . "/>\n"; |
| 2684 |
|
$r .= "\t</div>\n"; |
| 2685 |
|
} |
| 2686 |
|
|
| 2687 |
|
/** |