| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin Dashboard template. |
| 4 |
* |
| 5 |
* @since 1.8.2 |
| 6 |
* @version 1.8.8.6 |
| 7 |
* |
| 8 |
* @var array $notifications |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
if ( empty( $notifications ) || ! is_array( $notifications ) ) { |
| 16 |
return; |
| 17 |
} |
| 18 |
|
| 19 |
$charitable_notifications_count = 1; |
| 20 |
$charitable_notifications_total = count( $notifications ); |
| 21 |
|
| 22 |
|
| 23 |
?> |
| 24 |
|
| 25 |
<div class="charitable-container charitable-dashboard-notifications"> |
| 26 |
|
| 27 |
<div class="charitable-dashboard-notification-bar"> |
| 28 |
|
| 29 |
<?php if ( (int) $charitable_notifications_total > 1 ) : ?> |
| 30 |
<div class="charitable-dashboard-notification-navigation"> |
| 31 |
<a class="prev"> |
| 32 |
<span class="screen-reader-text"><?php esc_attr_e( 'Previous message', 'charitable' ); ?></span> |
| 33 |
<span aria-hidden="true">‹</span> |
| 34 |
</a> |
| 35 |
<a class="next"> |
| 36 |
<span class="screen-reader-text"><?php esc_attr_e( 'Next message', 'charitable' ); ?></span> |
| 37 |
<span aria-hidden="true">›</span> |
| 38 |
</a> |
| 39 |
</div> |
| 40 |
<?php else : ?> |
| 41 |
<div class="charitable-dashboard-notification-navigation"></div> |
| 42 |
<?php endif; ?> |
| 43 |
|
| 44 |
<a href="#" class="charitable-remove-dashboard-notification"></a> |
| 45 |
|
| 46 |
</div> |
| 47 |
|
| 48 |
<?php |
| 49 |
|
| 50 |
foreach ( $notifications as $charitable_notification_slug => $charitable_notification ) : |
| 51 |
|
| 52 |
$charitable_css_class = ! empty( $charitable_notification['custom_css'] ) ? $charitable_notification['custom_css'] : ''; |
| 53 |
$charitable_css_class .= $charitable_notifications_count === 1 ? '' : ' charitable-hidden'; |
| 54 |
$charitable_message_title = ! empty( $charitable_notification['title'] ) ? sanitize_text_field( $charitable_notification['title'] ) : esc_html__( 'Important', 'charitable' ); |
| 55 |
$charitable_message = ! empty( $charitable_notification['message'] ) ? $charitable_notification['message'] : ''; |
| 56 |
$charitable_message = wp_kses( |
| 57 |
$charitable_message, |
| 58 |
array( |
| 59 |
'a' => array( |
| 60 |
'href' => array(), |
| 61 |
'title' => array(), |
| 62 |
), |
| 63 |
'strong' => array(), |
| 64 |
'p' => array(), |
| 65 |
'ol' => array(), |
| 66 |
'ul' => array(), |
| 67 |
'li' => array(), |
| 68 |
'br' => array(), |
| 69 |
'h1' => array(), |
| 70 |
'h2' => array(), |
| 71 |
'h3' => array(), |
| 72 |
'h4' => array(), |
| 73 |
'h5' => array(), |
| 74 |
) |
| 75 |
); |
| 76 |
|
| 77 |
?> |
| 78 |
|
| 79 |
<div class="charitable-dashboard-notification <?php echo esc_attr( $charitable_css_class ); ?>" data-notification-number="<?php echo (int) $charitable_notifications_count; ?>" data-notification-id="<?php echo esc_attr( $charitable_notification_slug ); ?>" data-notification-type="<?php echo esc_attr( $charitable_notification['type'] ); ?>"> |
| 80 |
|
| 81 |
<div class="charitable-dashboard-notification-message"> |
| 82 |
<h4 class="charitable-dashboard-notification-headline"><?php echo esc_html( $charitable_message_title ); ?></h4> |
| 83 |
<?php echo $charitable_message; // phpcs:ignore ?> |
| 84 |
</div> |
| 85 |
|
| 86 |
</div> |
| 87 |
|
| 88 |
<?php |
| 89 |
|
| 90 |
++$charitable_notifications_count; |
| 91 |
|
| 92 |
endforeach; |
| 93 |
?> |
| 94 |
|
| 95 |
</div> |
| 96 |
|