| 1 |
<?php |
| 2 |
/** |
| 3 |
* BFB Admin Templates: "Load Form" modal (list all forms for current user). |
| 4 |
* |
| 5 |
* Prints Underscore template: |
| 6 |
* - tmpl-wpbc-bfb-tpl-modal-load_form |
| 7 |
* |
| 8 |
* @package Booking Calendar |
| 9 |
* @subpackage Booking Form Builder |
| 10 |
* @since 11.0.0 |
| 11 |
* @file ../includes/page-form-builder/admin-page-tpl/tpl-modal__form_open.php |
| 12 |
*/ |
| 13 |
|
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
class WPBC_BFB_Tpl__Load_Form { |
| 19 |
|
| 20 |
const TPL_MODAL_ID = 'wpbc-bfb-tpl-modal-load_form'; |
| 21 |
const MODAL_DOM_ID = 'wpbc_bfb_modal__load_form'; |
| 22 |
|
| 23 |
public static function register() { |
| 24 |
add_action( 'wpbc_hook_bfb_template__hidden_templates', array( __CLASS__, 'print_templates' ) ); |
| 25 |
} |
| 26 |
|
| 27 |
public static function print_templates() { |
| 28 |
self::template_modal(); |
| 29 |
} |
| 30 |
|
| 31 |
public static function template_modal() { |
| 32 |
|
| 33 |
$label_search = __( 'Search', 'booking' ); |
| 34 |
|
| 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_bfb wpbc_bfb_modal__full_screen wpbc_bfb_modal__include_section_load <?php echo esc_attr( self::MODAL_DOM_ID ); ?>" |
| 39 |
data-backdrop="static" data-keyboard="false" data-enforce-focus="false" |
| 40 |
tabindex="-1" role="dialog" aria-hidden="true"> |
| 41 |
|
| 42 |
<div class="modal-dialog"> |
| 43 |
<div class="modal-content"> |
| 44 |
|
| 45 |
<div class="modal-header"> |
| 46 |
<button type="button" class="close" aria-label="<?php echo esc_attr__( 'Close', 'booking' ); ?>" data-dismiss="modal" data-wpbc-bfb-cancel="1"> |
| 47 |
<span aria-hidden="true">×</span> |
| 48 |
</button> |
| 49 |
<h4 class="modal-title"><?php echo esc_html__( 'Load Booking Form', 'booking' ); ?></h4> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="modal-body wpbc_bfb_popup_modal__rows_container"> |
| 53 |
|
| 54 |
<div class="notice notice-error inline" data-wpbc-bfb-error="1" style="display:none;margin:0 0 12px 0;"></div> |
| 55 |
|
| 56 |
<div class="wpbc_bfb_popup_modal__row wpbc_bfb_popup_modal__row__search_key" style="margin-bottom:10px;"> |
| 57 |
<div class="wpbc_bfb_popup_modal__col wpbc_bfb_popup_modal__col__search_key_label"> |
| 58 |
<label for="wpbc_bfb_popup_modal__load_form__search" style="display:block;"><strong><?php echo esc_html( $label_search ); ?></strong></label> |
| 59 |
</div> |
| 60 |
<div class="wpbc_bfb_popup_modal__col wpbc_bfb_popup_modal__col__search_key_input"> |
| 61 |
<input type="text" |
| 62 |
id="wpbc_bfb_popup_modal__load_form__search" |
| 63 |
class="regular-text" |
| 64 |
style="width:100%;" |
| 65 |
placeholder="<?php esc_attr_e( 'Type to filter by title or key...', 'booking' ); ?>" |
| 66 |
/> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
|
| 70 |
<div class="wpbc_bfb_popup_modal__row"> |
| 71 |
<div class="wpbc_bfb_popup_modal__col"> |
| 72 |
<div class="wpbc_bfb_popup_modal__forms_loading_section" data-wpbc-bfb-forms-list="1" ></div> |
| 73 |
</div> |
| 74 |
</div> |
| 75 |
|
| 76 |
<div class="wpbc_bfb_popup_modal__row"> |
| 77 |
<div class="wpbc_bfb_popup_modal__col"> |
| 78 |
<div class="description" style="margin-top:8px;"> |
| 79 |
<?php esc_html_e( 'Select a form, then click “Load”.', 'booking' ); ?> |
| 80 |
</div> |
| 81 |
</div> |
| 82 |
<div class="wpbc_bfb_popup_modal__col"> |
| 83 |
<div data-wpbc-bfb-forms-pager="1" style="display:flex;gap:8px;align-items:center;justify-content:flex-end;padding:10px;border-top:1px solid #f0f0f1;margin-left:auto;"> |
| 84 |
<a href="#" class="button button-secondary" data-wpbc-bfb-page-prev="1" aria-disabled="true"><?php esc_html_e( 'Prev', 'booking' ); ?></a> |
| 85 |
<span data-wpbc-bfb-page-label="1" style="color:#666;font-size:12px;"><?php esc_html_e( 'Page', 'booking' ); ?> 1</span> |
| 86 |
<a href="#" class="button button-secondary" data-wpbc-bfb-page-next="1" aria-disabled="true"><?php esc_html_e( 'Next', 'booking' ); ?></a> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
|
| 91 |
</div> |
| 92 |
|
| 93 |
<div class="modal-footer"> |
| 94 |
<a href="javascript:void(0)" class="button button-primary disabled" aria-disabled="true" data-wpbc-bfb-confirm="1"> |
| 95 |
<?php echo esc_html__( 'Load', 'booking' ); ?> |
| 96 |
</a> |
| 97 |
<a href="javascript:void(0)" class="button button-secondary" data-dismiss="modal" data-wpbc-bfb-cancel="1"> |
| 98 |
<?php echo esc_html__( 'Cancel', 'booking' ); ?> |
| 99 |
</a> |
| 100 |
</div> |
| 101 |
<div class="wpbc_modal_hidden_elements" style="display:none !important;"> |
| 102 |
<div class="wpbc_bfb_popup_modal__forms_loading_spin_container" data-wpbc-bfb-forms-loading="1"> |
| 103 |
<?php |
| 104 |
wpbc_bfb_spins_loading_container_mini(); |
| 105 |
?> |
| 106 |
</div> |
| 107 |
</div> |
| 108 |
</div> |
| 109 |
</div> |
| 110 |
|
| 111 |
</div> |
| 112 |
</span> |
| 113 |
</script> |
| 114 |
<?php |
| 115 |
} |
| 116 |
} |
| 117 |
|
| 118 |
WPBC_BFB_Tpl__Load_Form::register(); |
| 119 |
|