|
@@ 2453-2458 (lines=6) @@
|
| 2450 |
|
$required_field_text = esc_html( apply_filters( 'jetpack_required_field_text', __( '(required)', 'jetpack' ) ) ); |
| 2451 |
|
|
| 2452 |
|
switch ( $field_type ) { |
| 2453 |
|
case 'email' : |
| 2454 |
|
$r .= "\n<div>\n"; |
| 2455 |
|
$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"; |
| 2456 |
|
$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"; |
| 2457 |
|
$r .= "\t</div>\n"; |
| 2458 |
|
break; |
| 2459 |
|
case 'telephone' : |
| 2460 |
|
$r .= "\n<div>\n"; |
| 2461 |
|
$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"; |
|
@@ 2464-2469 (lines=6) @@
|
| 2461 |
|
$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"; |
| 2462 |
|
$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"; |
| 2463 |
|
break; |
| 2464 |
|
case 'textarea' : |
| 2465 |
|
$r .= "\n<div>\n"; |
| 2466 |
|
$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"; |
| 2467 |
|
$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"; |
| 2468 |
|
$r .= "\t</div>\n"; |
| 2469 |
|
break; |
| 2470 |
|
case 'radio' : |
| 2471 |
|
$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"; |
| 2472 |
|
foreach ( $this->get_attribute( 'options' ) as $optionIndex => $option ) { |
|
@@ 2519-2525 (lines=7) @@
|
| 2516 |
|
|
| 2517 |
|
wp_enqueue_script( 'grunion-frontend', plugins_url( 'js/grunion-frontend.js', __FILE__ ), array( 'jquery', 'jquery-ui-datepicker' ) ); |
| 2518 |
|
break; |
| 2519 |
|
default : // text field |
| 2520 |
|
// note that any unknown types will produce a text input, so we can use arbitrary type names to handle |
| 2521 |
|
// input fields like name, email, url that require special validation or handling at POST |
| 2522 |
|
$r .= "\n<div>\n"; |
| 2523 |
|
$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"; |
| 2524 |
|
$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"; |
| 2525 |
|
$r .= "\t</div>\n"; |
| 2526 |
|
} |
| 2527 |
|
|
| 2528 |
|
/** |