| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div class="frm_wrap" id="frm_inbox_page"> |
| 7 |
<?php |
| 8 |
FrmAppHelper::get_admin_header( |
| 9 |
array( |
| 10 |
'label' => __( 'Inbox', 'formidable' ), |
| 11 |
'publish' => array( 'FrmInboxController::dismiss_all_button', compact( 'messages' ) ), |
| 12 |
) |
| 13 |
); |
| 14 |
?> |
| 15 |
<div id="post-body-content"> |
| 16 |
<div id="frm_message_list"> |
| 17 |
<?php |
| 18 |
|
| 19 |
$has_messages = ! empty( $messages ); |
| 20 |
foreach ( $messages as $key => $message ) { |
| 21 |
if ( ! isset( $message['icon'] ) ) { |
| 22 |
$message['icon'] = 'frm_tooltip_icon'; |
| 23 |
} |
| 24 |
|
| 25 |
?> |
| 26 |
<section class="frm_inbox_card" data-message="<?php echo esc_attr( $key ); ?>"> |
| 27 |
<span class="frm_inbox_card_icon" aria-hidden="true"> |
| 28 |
<?php FrmAppHelper::icon_by_class( 'frmfont ' . esc_attr( $message['icon'] ) ); ?> |
| 29 |
</span> |
| 30 |
<header> |
| 31 |
<h3> |
| 32 |
<?php echo esc_html( $message['subject'] ); ?> |
| 33 |
</h3> |
| 34 |
<span class="frm_inbox_date"> |
| 35 |
<?php |
| 36 |
if ( ! isset( $message['read'] ) || ! isset( $message['read'][ $user->ID ] ) ) { |
| 37 |
$inbox->mark_read( $key ); |
| 38 |
?> |
| 39 |
<span class="frm_inbox_unread"></span> |
| 40 |
<?php |
| 41 |
} |
| 42 |
|
| 43 |
printf( |
| 44 |
/* translators: %s: Time stamp */ |
| 45 |
esc_html__( '%s ago', 'formidable' ), |
| 46 |
esc_html( FrmAppHelper::human_time_diff( $message['created'] ) ) |
| 47 |
); |
| 48 |
?> |
| 49 |
</span> |
| 50 |
</header> |
| 51 |
<div class="frm_inbox_body"> |
| 52 |
<p><?php echo FrmAppHelper::kses( $message['message'], array( 'a', 'p', 'div', 'span', 'br' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> |
| 53 |
</div> |
| 54 |
<footer> |
| 55 |
<?php echo FrmAppHelper::kses( $message['cta'], array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 56 |
</footer> |
| 57 |
</section> |
| 58 |
<?php |
| 59 |
}//end foreach |
| 60 |
if ( $has_messages ) { |
| 61 |
?> |
| 62 |
<div style="margin:20px"><?php do_action( 'frm_page_footer', array( 'table' => 'inbox' ) ); ?></div> |
| 63 |
<?php |
| 64 |
} |
| 65 |
?> |
| 66 |
</div> |
| 67 |
|
| 68 |
<div class="frm_no_items <?php echo esc_attr( $has_messages ? 'frm_hidden' : '' ); ?>" id="frm_empty_inbox"> |
| 69 |
|
| 70 |
<?php |
| 71 |
FrmAppController::api_email_form( |
| 72 |
'subscribe', |
| 73 |
__( 'You don\'t have any messages', 'formidable' ), |
| 74 |
__( 'Get the details about new updates, tips, sales, and more. We\'ll keep you in the loop.', 'formidable' ) |
| 75 |
. "\n" . __( 'Want more news and email updates?', 'formidable' ) |
| 76 |
); |
| 77 |
?> |
| 78 |
|
| 79 |
<button id="frm-add-my-email-address" class="button-primary frm-button-primary"><?php esc_html_e( 'Subscribe', 'formidable' ); ?></button> |
| 80 |
</div> |
| 81 |
|
| 82 |
</div> |
| 83 |
</div> |
| 84 |
|