|
@@ 2478-2483 (lines=6) @@
|
| 2475 |
|
$required_field_text = esc_html( apply_filters( 'jetpack_required_field_text', __( '(required)', 'jetpack' ) ) ); |
| 2476 |
|
|
| 2477 |
|
switch ( $field_type ) { |
| 2478 |
|
case 'email' : |
| 2479 |
|
$r .= "\n<div>\n"; |
| 2480 |
|
$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"; |
| 2481 |
|
$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"; |
| 2482 |
|
$r .= "\t</div>\n"; |
| 2483 |
|
break; |
| 2484 |
|
case 'telephone' : |
| 2485 |
|
$r .= "\n<div>\n"; |
| 2486 |
|
$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"; |
|
@@ 2489-2494 (lines=6) @@
|
| 2486 |
|
$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"; |
| 2487 |
|
$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"; |
| 2488 |
|
break; |
| 2489 |
|
case 'textarea' : |
| 2490 |
|
$r .= "\n<div>\n"; |
| 2491 |
|
$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"; |
| 2492 |
|
$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"; |
| 2493 |
|
$r .= "\t</div>\n"; |
| 2494 |
|
break; |
| 2495 |
|
case 'radio' : |
| 2496 |
|
$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"; |
| 2497 |
|
foreach ( $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
|
@@ 2544-2550 (lines=7) @@
|
| 2541 |
|
|
| 2542 |
|
wp_enqueue_script( 'grunion-frontend', plugins_url( 'js/grunion-frontend.js', __FILE__ ), array( 'jquery', 'jquery-ui-datepicker' ) ); |
| 2543 |
|
break; |
| 2544 |
|
default : // text field |
| 2545 |
|
// note that any unknown types will produce a text input, so we can use arbitrary type names to handle |
| 2546 |
|
// input fields like name, email, url that require special validation or handling at POST |
| 2547 |
|
$r .= "\n<div>\n"; |
| 2548 |
|
$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"; |
| 2549 |
|
$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"; |
| 2550 |
|
$r .= "\t</div>\n"; |
| 2551 |
|
} |
| 2552 |
|
|
| 2553 |
|
/** |