| 1 |
<?php |
| 2 |
|
| 3 |
// Exit if accessed directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Checklist main modal "widget" window template. |
| 10 |
* |
| 11 |
* @since 1.8.1.15 |
| 12 |
* |
| 13 |
* @package Charitable/Admin/Templates |
| 14 |
*/ |
| 15 |
|
| 16 |
if ( ! \defined( 'ABSPATH' ) ) { |
| 17 |
exit; |
| 18 |
} |
| 19 |
|
| 20 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 21 |
// These are local template variables, not global variables. They are scoped to this template file. |
| 22 |
$checklist_class = Charitable_Checklist::get_instance(); |
| 23 |
$checklist_state = $checklist_class->get_checklist_option( 'status' ); |
| 24 |
$checklist_classes = $checklist_class->get_steps_css(); |
| 25 |
$check_list_completed = $checklist_class->is_checklist_completed() ? 'charitable-checklist-completed' : ''; |
| 26 |
$check_list_close_button_text = $checklist_class->is_checklist_completed() ? esc_attr__( 'Close checklist', 'charitable' ) : esc_attr__( 'Skip checklist', 'charitable' ); |
| 27 |
|
| 28 |
$checklist_stats = $checklist_class->get_steps_stats(); |
| 29 |
if ( ! is_array( $checklist_stats ) || empty( $checklist_stats ) ) { |
| 30 |
$checklist_stats = [ |
| 31 |
'completed' => 0, |
| 32 |
'total' => 5, |
| 33 |
]; |
| 34 |
} |
| 35 |
|
| 36 |
$base_class = 'init' === $checklist_state || 'start' === $checklist_state ? 'charitable-checklist-start' : ''; |
| 37 |
$base_class = $checklist_class->is_checklist_completed() ? 'charitable-checklist-completed' : $base_class; |
| 38 |
|
| 39 |
$start_checklist_url = $checklist_class->get_start_checklist_url(); |
| 40 |
$next_checklist_url = $checklist_class->get_next_checklist_url(); |
| 41 |
|
| 42 |
$closed_css = $checklist_class->get_checklist_option( 'window_closed' ) ? 'closed' : ''; |
| 43 |
// phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 44 |
|
| 45 |
?> |
| 46 |
<div class="charitable-checklist <?php echo esc_attr( $base_class ); ?>"> |
| 47 |
|
| 48 |
<div class="charitable-checklist-list-block <?php echo esc_attr( $closed_css ); ?>"> |
| 49 |
<i class="list-block-button checklist-toggle" title="<?php esc_attr_e( 'Toggle list', 'charitable' ); ?>"></i> |
| 50 |
<i class="list-block-button checklist-skip" title="<?php echo esc_html( $check_list_close_button_text ); ?>" |
| 51 |
data-cancel-title="<?php esc_attr_e( 'Cancel checklist', 'charitable' ); ?>"></i> |
| 52 |
<p> |
| 53 |
<?php |
| 54 |
echo wp_kses( |
| 55 |
sprintf( |
| 56 |
/* translators: %1$d - number of minutes, %2$s - singular or plural form of 'minute'. */ |
| 57 |
__( 'Complete the <b>Charitable Checklist</b> and get up and running within %1$s.', 'charitable' ), |
| 58 |
__( 'minutes', 'charitable' ) |
| 59 |
), |
| 60 |
[ 'b' => [] ] |
| 61 |
); |
| 62 |
?> |
| 63 |
</p> |
| 64 |
<ul class="charitable-checklist-list"> |
| 65 |
<li class="charitable-checklist-step3-item <?php echo esc_attr( $checklist_classes['connect-gateway'] ); ?>"><a href="<?php echo esc_url( admin_url( 'admin.php?page=charitable-setup-checklist#connect-gateway' ) ); ?>"><span></span><?php esc_html_e( 'Connect Your Gateway', 'charitable' ); ?></a></li> |
| 66 |
<li class="charitable-checklist-step1-item <?php echo esc_attr( $checklist_classes['general-settings'] ); ?>"><a href="<?php echo esc_url( admin_url( 'admin.php?page=charitable-setup-checklist#general-settings' ) ); ?>"><span></span><?php esc_html_e( 'Confirm General Settings', 'charitable' ); ?></a></li> |
| 67 |
<li class="charitable-checklist-step2-item <?php echo esc_attr( $checklist_classes['email-settings'] ); ?>"><a href="<?php echo esc_url( admin_url( 'admin.php?page=charitable-setup-checklist#email-settings' ) ); ?>"><span></span><?php esc_html_e( 'Check Email Settings', 'charitable' ); ?></a></li> |
| 68 |
<li class="charitable-checklist-step4-item <?php echo esc_attr( $checklist_classes['first-campaign'] ); ?>"><a href="<?php echo esc_url( admin_url( 'admin.php?page=charitable-setup-checklist#first-campaign' ) ); ?>"><span></span><?php esc_html_e( 'Create Your First Campaign', 'charitable' ); ?></a></li> |
| 69 |
<?php /* <li class="charitable-checklist-step5-item <?php echo esc_attr( $checklist_classes['first-donation'] ); ?>"><a href="<?php echo esc_url( admin_url( 'admin.php?page=charitable-setup-checklist#first-donation' ) ); ?>"><span></span><?php esc_html_e( 'View Your Donations', 'charitable' ); ?></a> */ ?></li> |
| 70 |
<li class="charitable-checklist-step6-item <?php echo esc_attr( $checklist_classes['next-level'] ); ?>"><a href="<?php echo esc_url( admin_url( 'admin.php?page=charitable-setup-checklist#next-level' ) ); ?>"><span></span><?php esc_html_e( 'Level Up Your Fundraising', 'charitable' ); ?></a></li> |
| 71 |
</ul> |
| 72 |
</div> |
| 73 |
|
| 74 |
<div class="charitable-checklist-bar" style="display:none"> |
| 75 |
<div></div> |
| 76 |
</div> |
| 77 |
|
| 78 |
<div class="charitable-checklist-block-timer"> |
| 79 |
<img src="<?php echo esc_url( charitable()->get_path( 'assets', false ) . '/images/charitable-logo.svg' ); ?>" alt="<?php esc_attr_e( 'Charitable', 'charitable' ); ?>"> |
| 80 |
<div> |
| 81 |
<h3><?php esc_html_e( 'Charitable Checklist', 'charitable' ); ?></h3> |
| 82 |
|
| 83 |
<?php |
| 84 |
|
| 85 |
if ( $checklist_class->is_checklist_completed() ) { |
| 86 |
|
| 87 |
?> |
| 88 |
<p> |
| 89 |
<?php |
| 90 |
|
| 91 |
echo esc_html__( 'Congrats! You did it!', 'charitable' ); |
| 92 |
|
| 93 |
?> |
| 94 |
</p> |
| 95 |
<?php } else { ?> |
| 96 |
<p> |
| 97 |
<?php |
| 98 |
|
| 99 |
echo wp_kses( |
| 100 |
sprintf( |
| 101 |
/* translators: %1$d - number of minutes, %2$s - singular or plural form of 'minute'. */ |
| 102 |
__( '%1$s of %2$s completed', 'charitable' ), |
| 103 |
'<span id="charitable-checklist-steps-completed">' . absint( $checklist_stats['completed'] ) . '</span>', |
| 104 |
'<span id="charitable-checklist-steps-total">' . absint( $checklist_stats['total'] ) . '</span>' |
| 105 |
), |
| 106 |
[ 'b' => [] ] |
| 107 |
); |
| 108 |
|
| 109 |
?> |
| 110 |
</p> |
| 111 |
<?php } ?> |
| 112 |
</div> |
| 113 |
</div> |
| 114 |
|
| 115 |
<div class="charitable-checklist-block-under-status"> |
| 116 |
<?php if ( ! $checklist_class->is_checklist_completed() ) : ?> |
| 117 |
|
| 118 |
<?php if ( $checklist_class->is_checklist_started() ) : ?> |
| 119 |
<a href="<?php echo esc_url( $next_checklist_url ); ?>" class="charitable-btn charitable-btn-orange"> |
| 120 |
<?php esc_html_e( 'Continue', 'charitable' ); ?> |
| 121 |
</a> |
| 122 |
<?php else : ?> |
| 123 |
<a href="<?php echo esc_url( $start_checklist_url ); ?>" class="charitable-btn charitable-btn-orange"> |
| 124 |
<?php esc_html_e( 'Start Checklist', 'charitable' ); ?> |
| 125 |
</a> |
| 126 |
<?php endif; ?> |
| 127 |
<?php else : ?> |
| 128 |
<p> |
| 129 |
<?php |
| 130 |
printf( |
| 131 |
/* translators: %1$s Opening strong tag, do not translate. %2$s Closing strong tag, do not translate. %3$s Opening anchor tag, do not translate. %4$s Closing anchor tag, do not translate. */ |
| 132 |
__( 'Please rate %1$sCharitable%2$s %3$s� |
| 133 |
� |
| 134 |
� |
| 135 |
� |
| 136 |
� |
| 137 |
%4$s on %3$sWordPress.org%4$s!', 'charitable' ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 138 |
'<strong>', |
| 139 |
'</strong>', |
| 140 |
'<a href="https://wpcharitable.com/charitable-admin-review/" rel="noopener noreferrer" target="_blank">', |
| 141 |
'</a>' |
| 142 |
); |
| 143 |
?> |
| 144 |
</p> |
| 145 |
<?php endif; ?> |
| 146 |
</div> |
| 147 |
</div> |
| 148 |
|