PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
booking / includes / page-setup-wizard / templates / confirmation-dialog.php

confirmation-dialog.php in Booking Calendar 11.9, at includes/page-setup-wizard/templates/confirmation-dialog.php

60 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Accessible confirmation dialog for shell and step-specific decisions.
4 *
5 * @package Booking Calendar
6 * @var array<string,mixed> $template_context Authorized dialog context.
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 $dialog_id = isset( $template_context['dialog_id'] ) ? (string) $template_context['dialog_id'] : '';
14 $dialog_action = isset( $template_context['action'] ) ? (string) $template_context['action'] : '';
15 $dialog_title = isset( $template_context['title'] ) ? (string) $template_context['title'] : '';
16 $dialog_description = isset( $template_context['description'] ) ? (string) $template_context['description'] : '';
17 $dialog_details = isset( $template_context['details'] ) && is_array( $template_context['details'] ) ? $template_context['details'] : array();
18 $dialog_note = isset( $template_context['note'] ) ? (string) $template_context['note'] : '';
19 $cancel_label = isset( $template_context['cancel_label'] ) ? (string) $template_context['cancel_label'] : __( 'Cancel', 'booking' );
20 $confirm_label = isset( $template_context['confirm_label'] ) ? (string) $template_context['confirm_label'] : __( 'Continue', 'booking' );
21 $dialog_classes = 'wpbc_setup_wizard__dialog';
22
23 $dialog_details = array_values(
24 array_filter(
25 array_map(
26 static function ( $dialog_detail ) {
27 return is_scalar( $dialog_detail ) ? trim( (string) $dialog_detail ) : '';
28 },
29 $dialog_details
30 )
31 )
32 );
33
34 if ( ! empty( $dialog_details ) ) {
35 $dialog_classes .= ' wpbc_setup_wizard__dialog--with-details';
36 }
37 ?>
38 <div class="wpbc_setup_wizard__dialog-backdrop" data-wpbc-setup-wizard-dialog="<?php echo esc_attr( $dialog_action ); ?>" hidden>
39 <div class="<?php echo esc_attr( $dialog_classes ); ?>" id="<?php echo esc_attr( $dialog_id ); ?>" role="dialog" aria-modal="true" aria-labelledby="<?php echo esc_attr( $dialog_id ); ?>-title" aria-describedby="<?php echo esc_attr( $dialog_id ); ?>-description" tabindex="-1">
40 <h2 id="<?php echo esc_attr( $dialog_id ); ?>-title"><?php echo esc_html( $dialog_title ); ?></h2>
41 <div class="wpbc_setup_wizard__dialog-content" id="<?php echo esc_attr( $dialog_id ); ?>-description">
42 <p><?php echo esc_html( $dialog_description ); ?></p>
43 <?php if ( ! empty( $dialog_details ) ) : ?>
44 <ul class="wpbc_setup_wizard__dialog-details">
45 <?php foreach ( $dialog_details as $dialog_detail ) : ?>
46 <li><?php echo esc_html( $dialog_detail ); ?></li>
47 <?php endforeach; ?>
48 </ul>
49 <?php endif; ?>
50 <?php if ( '' !== $dialog_note ) : ?>
51 <p class="wpbc_setup_wizard__dialog-note"><?php echo esc_html( $dialog_note ); ?></p>
52 <?php endif; ?>
53 </div>
54 <div class="wpbc_setup_wizard__dialog-actions">
55 <button type="button" class="button" data-wpbc-setup-wizard-dialog-cancel><?php echo esc_html( $cancel_label ); ?></button>
56 <button type="button" class="button button-primary" data-wpbc-setup-wizard-confirm="<?php echo esc_attr( $dialog_action ); ?>"><?php echo esc_html( $confirm_label ); ?></button>
57 </div>
58 </div>
59 </div>
60