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