|
@@ 2594-2599 (lines=6) @@
|
| 2591 |
|
$required_field_text = esc_html( apply_filters( 'jetpack_required_field_text', __( '(required)', 'jetpack' ) ) ); |
| 2592 |
|
|
| 2593 |
|
switch ( $field_type ) { |
| 2594 |
|
case 'email' : |
| 2595 |
|
$r .= "\n<div>\n"; |
| 2596 |
|
$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"; |
| 2597 |
|
$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"; |
| 2598 |
|
$r .= "\t</div>\n"; |
| 2599 |
|
break; |
| 2600 |
|
case 'telephone' : |
| 2601 |
|
$r .= "\n<div>\n"; |
| 2602 |
|
$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"; |
|
@@ 2605-2610 (lines=6) @@
|
| 2602 |
|
$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"; |
| 2603 |
|
$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"; |
| 2604 |
|
break; |
| 2605 |
|
case 'textarea' : |
| 2606 |
|
$r .= "\n<div>\n"; |
| 2607 |
|
$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"; |
| 2608 |
|
$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"; |
| 2609 |
|
$r .= "\t</div>\n"; |
| 2610 |
|
break; |
| 2611 |
|
case 'radio' : |
| 2612 |
|
$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"; |
| 2613 |
|
foreach ( $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
|
@@ 2660-2666 (lines=7) @@
|
| 2657 |
|
|
| 2658 |
|
wp_enqueue_script( 'grunion-frontend', plugins_url( 'js/grunion-frontend.js', __FILE__ ), array( 'jquery', 'jquery-ui-datepicker' ) ); |
| 2659 |
|
break; |
| 2660 |
|
default : // text field |
| 2661 |
|
// note that any unknown types will produce a text input, so we can use arbitrary type names to handle |
| 2662 |
|
// input fields like name, email, url that require special validation or handling at POST |
| 2663 |
|
$r .= "\n<div>\n"; |
| 2664 |
|
$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"; |
| 2665 |
|
$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"; |
| 2666 |
|
$r .= "\t</div>\n"; |
| 2667 |
|
} |
| 2668 |
|
|
| 2669 |
|
/** |