| 1 |
<?php |
| 2 |
/** |
| 3 |
* Open-ended setup journey rail. |
| 4 |
* |
| 5 |
* @package Booking Calendar |
| 6 |
* @var array<string,mixed> $template_context Authorized rail context. |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
?> |
| 13 |
<aside class="wpbc_setup_wizard__rail" aria-labelledby="wpbc-setup-wizard-journey-title"> |
| 14 |
<h2 id="wpbc-setup-wizard-journey-title"><?php esc_html_e( 'Your setup journey', 'booking' ); ?></h2> |
| 15 |
<ol class="wpbc_setup_wizard__steps"> |
| 16 |
<?php foreach ( $template_context['rail_items'] as $rail_item ) : ?> |
| 17 |
<li class="wpbc_setup_wizard__step wpbc_setup_wizard__step--<?php echo esc_attr( $rail_item['state'] ); ?>"<?php echo 'current' === $rail_item['state'] ? ' aria-current="step"' : ''; ?>> |
| 18 |
<span class="wpbc_setup_wizard__step-marker" aria-hidden="true"><?php echo 'complete' === $rail_item['state'] ? '✓' : ''; ?></span> |
| 19 |
<?php if ( 'complete' === $rail_item['state'] ) : ?> |
| 20 |
<?php |
| 21 |
/* translators: %s: Setup Wizard step label. */ |
| 22 |
$step_link_label = sprintf( __( 'Go to %s setup step', 'booking' ), $rail_item['label'] ); |
| 23 |
?> |
| 24 |
<button |
| 25 |
type="button" |
| 26 |
class="wpbc_setup_wizard__step-label wpbc_setup_wizard__step-link" |
| 27 |
data-wpbc-setup-wizard-edit-step="<?php echo esc_attr( $rail_item['id'] ); ?>" |
| 28 |
aria-label="<?php echo esc_attr( $step_link_label ); ?>" |
| 29 |
><?php echo esc_html( $rail_item['label'] ); ?></button> |
| 30 |
<?php else : ?> |
| 31 |
<span class="wpbc_setup_wizard__step-label"><?php echo esc_html( $rail_item['label'] ); ?></span> |
| 32 |
<?php endif; ?> |
| 33 |
</li> |
| 34 |
<?php endforeach; ?> |
| 35 |
<li class="wpbc_setup_wizard__step wpbc_setup_wizard__step--future" aria-hidden="true"> |
| 36 |
<span class="wpbc_setup_wizard__step-marker"></span> |
| 37 |
</li> |
| 38 |
</ol> |
| 39 |
<p class="wpbc_setup_wizard__rail-note"><?php echo esc_html( $template_context['rail_note'] ); ?></p> |
| 40 |
</aside> |
| 41 |
|