| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin Notifications template. |
| 4 |
* |
| 5 |
* @since 1.8.3 |
| 6 |
* @version 1.8.8.6 |
| 7 |
* |
| 8 |
* @package Charitable/Admin/Templates |
| 9 |
* @var array $notifications |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
$charitable_active_count = intval( $args['notifications']['active_count'] ); |
| 17 |
$charitable_active_count_string = esc_html( $args['notifications']['active_count'] ); |
| 18 |
$charitable_remaining_active_count = $charitable_active_count > 4 ? $charitable_active_count - 3 : 0; |
| 19 |
$charitable_dismissed_count = intval( $args['notifications']['dismissed_count'] ); |
| 20 |
$charitable_no_items_css = ( $charitable_active_count > 0 ) ? 'charitable-hidden' : ''; |
| 21 |
$charitable_yes_items_css = ( $charitable_active_count === 0 ) ? 'charitable-hidden' : ''; |
| 22 |
$charitable_notifications_title = $charitable_active_count > 1 ? esc_html__( 'New Notifications', 'charitable' ) : esc_html__( 'New Notification', 'charitable' ); |
| 23 |
|
| 24 |
?> |
| 25 |
|
| 26 |
|
| 27 |
<div class="charitable-container charitable-report-card charitable-dashboard-notifications"> |
| 28 |
<div class="header"> |
| 29 |
<?php if ( $charitable_active_count ) : ?> |
| 30 |
<h4>(<span id="new-notifications-count-dashboard"><?php echo esc_html( $charitable_active_count_string ); ?></span>) <?php echo esc_html( $charitable_notifications_title ); ?></h4> |
| 31 |
<?php else : ?> |
| 32 |
<h4><?php echo esc_html__( 'Notifications', 'charitable' ); ?></h4> |
| 33 |
<?php endif; ?> |
| 34 |
|
| 35 |
<a href="#" class="charitable-toggle"><i class="fa fa-angle-down charitable-angle-down"></i></a> |
| 36 |
</div> |
| 37 |
<div class="charitable-toggle-container charitable-report-ui"> |
| 38 |
<div class="no-items <?php echo esc_attr( $charitable_no_items_css ); ?>"> |
| 39 |
<p><strong><?php echo esc_html__( 'There are currently no active notifications.', 'charitable' ); ?></strong></p> |
| 40 |
<p class="link charitable-view-notifications"><a href="#"><?php echo esc_html__( 'View Notifications', 'charitable' ); ?><img src="<?php echo charitable()->get_path( 'assets', false ) . 'images/icons/east.svg'; // phpcs:ignore ?>" /></a></p> |
| 41 |
</div> |
| 42 |
<div class="the-list <?php echo esc_attr( $charitable_yes_items_css ); ?>"> |
| 43 |
<?php echo $args['notifications']['active_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
<div class="more"> |
| 47 |
<?php if ( $charitable_remaining_active_count ) : ?> |
| 48 |
<a href="#"><?php wp_sprintf( 'You have %d more notifications', $charitable_remaining_active_count ); ?><img src="<?php echo charitable()->get_path( 'assets', false ) . 'images/icons/east.svg'; // phpcs:ignore ?>" /></a> |
| 49 |
<?php elseif ( $charitable_active_count > 0 || $charitable_dismissed_count > 0 ) : ?> |
| 50 |
<a href="#"><?php esc_html_e( 'View Notifications', 'charitable' ); ?><img src="<?php echo charitable()->get_path( 'assets', false ) . 'images/icons/east.svg'; // phpcs:ignore ?>" /></a> |
| 51 |
<?php endif; ?> |
| 52 |
</div> |
| 53 |
|
| 54 |
</div> |