| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
if ( isset( $include_extra_container ) ) { ?> |
| 7 |
<div class="<?php echo esc_attr( $include_extra_container ); ?>" id="frm_form_<?php echo esc_attr( $form->id ); ?>_container"> |
| 8 |
<?php |
| 9 |
} |
| 10 |
|
| 11 |
// phpcs:ignore Universal.Operators.StrictComparisons |
| 12 |
if ( isset( $message ) && $message != '' ) { |
| 13 |
if ( FrmAppHelper::is_admin() ) { |
| 14 |
?> |
| 15 |
<div id="message" class="frm_updated_message" role="status"><?php echo wp_kses_post( $message ); ?></div> |
| 16 |
<?php |
| 17 |
} else { |
| 18 |
FrmFormsHelper::maybe_get_scroll_js( $form->id ); |
| 19 |
|
| 20 |
// We need to allow scripts here for javascript in the success message |
| 21 |
echo FrmAppHelper::maybe_kses( $message ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
if ( ! empty( $errors ) && is_array( $errors ) ) { |
| 26 |
if ( isset( $form ) && is_object( $form ) ) { |
| 27 |
FrmFormsHelper::get_scroll_js( $form->id ); |
| 28 |
} |
| 29 |
?> |
| 30 |
<div class="<?php echo esc_attr( FrmFormsHelper::form_error_class() ); ?>" role="alert"> |
| 31 |
<?php |
| 32 |
$img = ''; |
| 33 |
|
| 34 |
if ( ! FrmAppHelper::is_admin() ) { |
| 35 |
$img = apply_filters( 'frm_error_icon', $img ); |
| 36 |
|
| 37 |
if ( $img ) { |
| 38 |
echo '<img src="' . esc_url( $img ) . '" alt="" />'; |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
FrmFormsHelper::show_errors( compact( 'img', 'errors', 'form' ) ); |
| 43 |
|
| 44 |
?> |
| 45 |
</div> |
| 46 |
<?php |
| 47 |
}//end if |
| 48 |
|
| 49 |
if ( isset( $include_extra_container ) ) { |
| 50 |
?> |
| 51 |
</div> |
| 52 |
<?php |
| 53 |
} |
| 54 |
|