| 1 |
<?php |
| 2 |
/** |
| 3 |
* BFB Admin Templates: Generic Confirm Delete modal. |
| 4 |
* |
| 5 |
* Prints Underscore template: |
| 6 |
* - tmpl-wpbc-bfb-tpl-modal-confirm-delete |
| 7 |
* |
| 8 |
* @package Booking Calendar |
| 9 |
* @subpackage Booking Form Builder |
| 10 |
* @since 11.0.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
class WPBC_BFB_Tpl__Confirm_Delete { |
| 18 |
|
| 19 |
const TPL_MODAL_ID = 'wpbc-bfb-tpl-modal-confirm-delete'; |
| 20 |
const MODAL_DOM_ID = 'wpbc_bfb_modal__confirm_delete'; |
| 21 |
|
| 22 |
public static function register() { |
| 23 |
add_action( 'wpbc_hook_bfb_template__hidden_templates', array( __CLASS__, 'print_templates' ) ); |
| 24 |
} |
| 25 |
|
| 26 |
public static function print_templates() { |
| 27 |
self::template_modal(); |
| 28 |
} |
| 29 |
|
| 30 |
public static function template_modal() { |
| 31 |
|
| 32 |
/* translators: 1: name of element to delete. */ |
| 33 |
$msg_tpl = __( 'Delete %s? This cannot be undone.', 'booking' ); |
| 34 |
$msg_html = sprintf( $msg_tpl, '<strong class="wpbc_bfb__confirm_label"></strong>' ); |
| 35 |
?> |
| 36 |
<script type="text/html" id="tmpl-<?php echo esc_attr( self::TPL_MODAL_ID ); ?>"> |
| 37 |
<span class="wpdevelop"> |
| 38 |
<div id="<?php echo esc_attr( self::MODAL_DOM_ID ); ?>" class="modal wpbc_popup_modal wpbc_modal_in_listing" tabindex="-1" role="dialog" aria-hidden="true"> |
| 39 |
|
| 40 |
<div class="modal-dialog"> |
| 41 |
<div class="modal-content"> |
| 42 |
|
| 43 |
<div class="modal-header"> |
| 44 |
<button type="button" class="close" aria-label="<?php echo esc_attr__( 'Close', 'booking' ); ?>" data-dismiss="modal" data-wpbc-bfb-cancel="1"> |
| 45 |
<span aria-hidden="true">×</span> |
| 46 |
</button> |
| 47 |
<h4 class="modal-title"> |
| 48 |
<?php echo esc_html__( 'Confirm delete', 'booking' ); ?> |
| 49 |
</h4> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="modal-body"> |
| 53 |
<p class="help-block wpbc_bfb__confirm_message"> |
| 54 |
<?php echo wp_kses_post( $msg_html ); ?> |
| 55 |
</p> |
| 56 |
</div> |
| 57 |
|
| 58 |
<div class="modal-footer"> |
| 59 |
<a href="javascript:void(0)" class="button button-primary" data-wpbc-bfb-confirm="1"> |
| 60 |
<?php echo esc_html__( 'Delete', 'booking' ); ?> |
| 61 |
</a> |
| 62 |
<a href="javascript:void(0)" class="button button-secondary" data-dismiss="modal" data-wpbc-bfb-cancel="1" > |
| 63 |
<?php echo esc_html__( 'Cancel', 'booking' ); ?> |
| 64 |
</a> |
| 65 |
</div> |
| 66 |
|
| 67 |
</div> |
| 68 |
</div> |
| 69 |
|
| 70 |
</div> |
| 71 |
</span> |
| 72 |
</script> |
| 73 |
<?php |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
WPBC_BFB_Tpl__Confirm_Delete::register(); |
| 78 |
|