PluginProbe
Booking Calendar / 10.11.2
Booking Calendar v10.11.2
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-form-simple / page-form-simple.php

page-form-simple.php in Booking Calendar 10.11.2, at includes/page-form-simple/page-form-simple.php

1,510 lines 78.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php /**
2 * @version 1.0
3 * @package Booking Calendar
4 * @category Booking Form Settings
5 * @author wpdevelop
6 *
7 * @web-site https://wpbookingcalendar.com/
8 * @email [email protected]
9 *
10 * @modified 2016-03-23
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
15 require_once( WPBC_PLUGIN_DIR . '/includes/page-form-simple/form_simple__toolbar_free.php' );
16 require_once( WPBC_PLUGIN_DIR . '/includes/page-form-simple/form_simple__submit.php' );
17 require_once( WPBC_PLUGIN_DIR . '/includes/page-form-simple/form_simple__timeslots.php' ); // Timeslots Generator
18 require_once( WPBC_PLUGIN_DIR . '/includes/page-form-simple/form_simple__preview.php' ); // Preview
19 require_once( WPBC_PLUGIN_DIR . '/includes/page-form-simple/form_simple__preview_templates.php' ); // Templates - Simple Booking Form
20 require_once( WPBC_PLUGIN_DIR . '/includes/page-form-simple/form_simple__auto_show_timeslots.php' ); // Auto Load Time Slots -- Editing or Adding form
21
22 /**
23 * Show Content
24 * Update Content
25 * Define Slug
26 * Define where to show
27 */
28 class WPBC_Page_SettingsFormFieldsFree extends WPBC_Page_Structure {
29
30 /** Need define some filters */
31 public function __construct() {
32
33
34
35
36 /**
37 * We need to update these fields after usual update process :
38 * 'booking_form'
39 * 'booking_form_show'
40 * 'booking_form_visual'
41 */
42 add_bk_action( 'wpbc_other_versions_activation', array( $this, 'activate' ) ); // Activate
43 add_bk_action( 'wpbc_other_versions_deactivation', array( $this, 'deactivate' ) ); // Deactivate
44
45 parent::__construct();
46 }
47
48 public function in_page() {
49 return 'wpbc-settings';
50 }
51
52 public function tabs() {
53
54
55 // Init vars.
56 $separator_i = 0;
57 $tabs = array();
58 $subtabs = array();
59 $subtab_default = array(
60 'type' => 'subtab', // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'.
61 'title' => '', // Example: __( 'Dashboard' // Title of TAB.
62 'page_title' => '', // __( 'Search Availability' // Title of Page.
63 'hint' => '', // __( 'Configure the layout and functionality of both the search form and search results.' // Hint.
64 'link' => '', // wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_dashboard_tab', // Link.
65 'css_classes' => '', // cls CSS .
66 'font_icon' => 'wpbc_icn_dashboard',
67 'font_icon_right' => 'wpbc-bi-question-circle', // 'wpbc-bi-question-circle' .
68 'default' => false, // Is this sub tab activated by default or not: true || false.
69 );
70
71 $tabs[ 'form' ] = array(
72 'is_show_top_path' => false, // true | false. By default value is: false.
73 'left_navigation__default_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
74 'page_title' => __( 'Booking Form', 'booking'), // Header - Title. If false, than hidden.
75 'page_description' => __('Add, remove, or customize fields in your booking form.','booking'), // Header - Title Description. If false, than hidden.
76 'title' => __( 'Booking Form', 'booking') // Title of TAB
77 , 'page_title'=> __( 'Booking Form', 'booking') // Title of Page
78 , 'hint' => __( 'Add, remove, or customize fields in your booking form.', 'booking') // Hint
79 //, 'css_classes'=> '' // CSS class(es)
80 , 'font_icon' => 'wpbc_icn_dashboard _customize dashboard rtt draw' // CSS definition of forn Icon
81 , 'default' => false // Is this tab activated by default or not: true || false.
82 , 'subtabs' => array()
83 , 'folder_style' => 'order:10;',
84 );
85
86 $section_id = 'wpbc_general_settings_booking_form_fields_metabox';
87 $subtabs['booking_form_fields'] = array_merge(
88 $subtab_default,
89 array(
90 'title' => __( 'Booking Form Fields', 'booking' ),
91 'page_title' => __( 'Booking Form Fields', 'booking' ),
92 'hint' => __( 'Add, remove, or customize fields in your booking form.', 'booking' ),
93 'font_icon' => 'wpbc-bi-ui-radios',
94 'font_icon_right' => 'wpbc-bi-question-circle',
95 'css_classes' => 'do_expand__' . $section_id . '_link', // sub_bold', .
96 //'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
97 'link' => wpbc_get_settings_url() . '&tab=form',
98 'default' => true,
99 )
100 );
101 $tabs[ 'form' ]['subtabs'] = $subtabs;
102
103
104 if ( ! class_exists( 'wpdev_bk_personal' ) ) // FixIn: 8.1.1.12.
105 $tabs[ 'upgrade-link' ] = array(
106 'title' => __('Free vs Pro','booking') // Title of TAB
107 , 'hint' => __('Upgrade to higher versions', 'booking') // Hint
108 //, 'page_title' => __('Upgrade', 'booking') // Title of Page
109 , 'link' => 'https://wpbookingcalendar.com/features/' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link
110 , 'position' => 'right' // 'left' || 'right' || ''
111 //, 'css_classes' => '' // CSS class(es)
112 //, 'icon' => '' // Icon - link to the real PNG img
113 , 'font_icon' => 'wpbc_icn_redeem'// CSS definition of forn Icon
114 //, 'default' => false // Is this tab activated by default or not: true || false.
115 //, 'subtabs' => array()
116 , 'folder_style' => 'order:9999;'
117 );
118
119 return $tabs;
120 }
121
122
123 public function content() {
124 $this->css();
125
126 // Define Notices Section and show some static messages, if needed
127 do_action( 'wpbc_hook_settings_page_header', 'form_field_free_settings');
128
129 if ( ! wpbc_is_mu_user_can_be_here('activated_user') ) return false; // Check if MU user activated, otherwise show Warning message.
130 //if ( ! wpbc_is_mu_user_can_be_here('only_super_admin') ) return false; // User is not Super admin, so exit. Basically its was already checked at the bottom of the PHP file, just in case.
131
132
133 // -------------------------------------------------------------------------------------------------------------
134 // Submit
135 // -------------------------------------------------------------------------------------------------------------
136 $submit_form_name = 'wpbc_form_field_free'; // Define form name
137 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
138 if ( isset( $_POST[ 'is_form_sbmitted_' . $submit_form_name ] ) ) {
139 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }
140 $nonce_gen_time = check_admin_referer( 'wpbc_settings_page_' . $submit_form_name ); // Its stop show anything on submitting, if it's not refear to the original page
141
142 wpbc_simple_form__page_save_submit(); // Save Changes
143 }
144
145 echo '<span class="wpdevelop">';
146 wpbc_js_for_bookings_page(); // JavaScript: Tooltips, Popover, Datepick (js & css) //////////////////
147 echo '</span>';
148
149
150 // -------------------------------------------------------------------------------------------------------------
151 // Content
152 // -------------------------------------------------------------------------------------------------------------
153 ?><div class="clear"></div>
154 <div class="wpbc_settings_flex_container"><?php
155
156 $this->left_navigation_menu_template();
157
158 ?><div class="wpbc_settings_flex_container_right"><?php
159
160 // This div required for hiding toolbar, if clicked items in Left Nav Bar.
161 ?><div id="wpbc_settings__custom_booking_forms_fields__toolbar" class="wpbc_container_hide__on_left_nav_click" style="margin:0 0 25px;"><?php
162
163 wpbc_simple_form__toolbar_free();
164
165 ?></div><?php
166
167
168 ?><form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post" style="width:100%;"><?php
169 ?><span class="metabox-holder"><?php
170 // N o n c e field, and key for checking S u b m i t
171 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
172
173 ?><input type="hidden" name="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" id="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" value="1" /><?php
174 ?><input type="hidden" name="form_visible_section" id="form_visible_section" value="" /><?php
175 ?><input type="hidden" name="reset_to_default_form" id="reset_to_default_form" value="" /><?php
176 ?><input type="hidden" name="booking_form_structure_type" id="booking_form_structure_type" value="<?php echo esc_attr( get_bk_option( 'booking_form_structure_type' ) ); ?>" /><?php
177
178 ?><div id="wpbc_settings__form_fields_metabox" class="wpbc_container_hide__on_left_nav_click"><?php
179
180 $this->content_section__form_fields();
181
182 ?></div><?php
183
184 wpbc_open_meta_box_section( 'wpbc_settings__form_layout', __('Form Layout', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false, 'css_class'=>'postbox wpbc_container_hide__on_left_nav_click' ) );
185 $this->content_section__form_layout();
186 wpbc_close_meta_box_section();
187
188 $is_can = apply_bk_filter( 'multiuser_is_user_can_be_here', true, 'only_super_admin' );
189 if ( $is_can ) {
190 wpbc_open_meta_box_section( 'wpbc_settings__form_theme', __('Color Theme', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false, 'css_class'=>'postbox wpbc_container_hide__on_left_nav_click' ) );
191
192 $this->content_section__form_color_theme();
193
194 ?><table class="form-table"><tbody><tr valign="top" class="wpbc_tr_booking_form_skins"><th scope="row"></th><td><fieldset><?php
195
196 ?><div class="wpbc_widget wpbc_widget_color_skins">
197 <div class="wpbc_widget_content wpbc_ajx_toolbar wpbc_no_background" style="margin:0 0 20px;">
198 <div class="ui_container" ><?php
199
200 $this->content_section__calendar_skin();
201
202 $this->content_section__time_picker_skin();
203
204 ?></div></div></div><?php
205
206 ?></fieldset></td></tr></tbody></table><?php
207
208 wpbc_close_meta_box_section();
209
210
211 wpbc_open_meta_box_section( 'wpbc_settings__form_options', __('Form Options', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false, 'css_class'=>'postbox wpbc_container_hide__on_left_nav_click' ) );
212 $this->content_section__form_options();
213 wpbc_close_meta_box_section();
214 }
215 ?></span><?php
216 // -----------------------------------------------------------------------------------------------------
217 // Save button
218 // -----------------------------------------------------------------------------------------------------
219 ?><div class="clear" style="height:5px;"></div>
220 <input type="submit" value="<?php esc_attr_e('Save Changes','booking'); ?>" class="button button-primary wpbc_submit_button wpbc_submit_button_trigger" />
221 </form>
222 <?php
223 //wpbc_show_preview__form();
224 ?>
225 </div>
226 </div><?php
227
228
229 wpbc_show_preview__form();
230
231 // Define templates and write JavaScript for Timeslots in ../generator-timeslots.php
232 do_action( 'wpbc_hook_settings_page_footer', 'form_field_free_settings' );
233
234 }
235
236
237 public function left_navigation_menu_template(){
238
239 ?>
240 <div class="wpbc_settings_flex_container_left wpbc_settings_flex_container_can_collapse">
241
242 <div class="wpbc_settings_navigation_column">
243 <div id="wpbc_settings__form_fields_tab" class="wpbc_settings_navigation_item wpbc_settings_navigation_item_active">
244 <a onclick="javascript:wpbc_navigation_click_show_section(this,'#wpbc_settings__form_fields_metabox,#wpbc_settings__custom_booking_forms_fields__toolbar', '.wpbc_container_hide__on_left_nav_click' );" href="javascript:void(0);">
245 <span><?php esc_html_e( 'Form Fields', 'booking' ); ?></span>
246 <i class="tooltip_right wpbc_set_nav__right_icon menu_icon icon-1x wpbc_icn_format_align_left" data-original-title="<?php echo esc_attr( __( 'Form Fields', 'booking' ) ); ?>"></i>
247 </a>
248 </div>
249 <div id="wpbc_settings__form_layout_tab" class="wpbc_settings_navigation_item">
250 <a onclick="javascript:wpbc_navigation_click_show_section(this,'#wpbc_settings__form_layout_metabox', '.wpbc_container_hide__on_left_nav_click' );" href="javascript:void(0);">
251 <span><?php esc_html_e( 'Form Layout', 'booking' ); ?></span>
252 <i class="tooltip_right wpbc_set_nav__right_icon menu_icon icon-1x wpbc_icn_dashboard" data-original-title="<?php echo esc_attr( __( 'Form Layout', 'booking' ) ); ?>"></i>
253 </a>
254 </div><?php
255
256 $is_can = apply_bk_filter( 'multiuser_is_user_can_be_here', true, 'only_super_admin' );
257 if ( $is_can ) {
258
259 ?><div id="wpbc_settings__form_theme_tab" class="wpbc_settings_navigation_item">
260 <a onclick="javascript:wpbc_navigation_click_show_section(this,'#wpbc_settings__form_theme_metabox', '.wpbc_container_hide__on_left_nav_click' );" href="javascript:void(0);">
261 <span><?php esc_html_e( 'Color Theme', 'booking' ); ?></span>
262 <i class="tooltip_right wpbc_set_nav__right_icon menu_icon icon-1x wpbc_icn_format_color_text 00wpbc-bi-pencil" data-original-title="<?php echo esc_attr( __( 'Color Theme', 'booking' ) ); ?>"></i>
263 </a>
264 </div>
265 <div id="wpbc_settings__form_options_tab" class="wpbc_settings_navigation_item">
266 <a onclick="javascript:wpbc_navigation_click_show_section(this,'#wpbc_settings__form_options_metabox', '.wpbc_container_hide__on_left_nav_click' );" href="javascript:void(0);">
267 <span><?php esc_html_e( 'Options', 'booking' ); ?></span>
268 <i class="tooltip_right wpbc_set_nav__right_icon menu_icon icon-1x wpbc_icn_tune" data-original-title="<?php echo esc_attr( __( 'Options', 'booking' ) ); ?>"></i>
269 </a>
270 </div><?php
271
272 }
273 ?><div id="wpbc_settings__form_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border0">
274 <a onclick="javascript:wpbc_navigation_click_show_section(this,'#wpbc_settings__form_preview_metabox', '.wpbc_container_hide__on_left_nav_click000' );" href="javascript:void(0);">
275 <span><?php esc_html_e( 'Preview', 'booking' ); ?></span>
276 <i class="tooltip_right wpbc_set_nav__right_icon menu_icon icon-1x wpbc-bi-eye" data-original-title="<?php echo esc_attr( __( 'Preview', 'booking' ) ); ?>"></i>
277 </a>
278 </div>
279 <div id="wpbc_settings__form_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item0 wpbc_navigation_top_border">
280 <a onclick="javascript:jQuery(this).parents('.wpbc_settings_flex_container_can_collapse').toggleClass('wpbc_container_collapsed');
281 jQuery( this ).find('.wpbc_icon_for_collapse').removeClass('wpbc_icn_chevron_left wpbc_icn_chevron_right');
282 if (jQuery(this).parents('.wpbc_settings_flex_container_can_collapse').hasClass('wpbc_container_collapsed')){
283 jQuery( this ).find('.wpbc_icon_for_collapse').addClass('wpbc_icn_chevron_right');
284 } else {
285 jQuery( this ).find('.wpbc_icon_for_collapse').addClass('wpbc_icn_chevron_left');
286 }
287 jQuery( this ).blur();
288 "
289 href="javascript:void(0);" style="font-weight: 400;font-size:0.94em;">
290 <span><?php esc_html_e( 'Collapse menu', 'booking' ); ?></span>
291 <i class="wpbc_set_nav__right_icon menu_icon icon-1x wpbc_icn_chevron_left tooltip_right wpbc_icon_for_collapse"
292 data-original-title="<?php echo esc_attr( __( 'Collapse menu', 'booking' ) ); ?>"
293 style="margin-top:0;"></i>
294 </a>
295 </div>
296 </div>
297 </div>
298 <?php
299 }
300
301
302 public function content_section__form_fields(){
303
304 // Fields Generator
305 ?>
306 <span class="metabox_wpbc_form_field_free_generator" style="display:none;">
307 <div class="clear"></div>
308 <span class="metabox-holder">
309 <div class="wpbc_settings_row " >
310 <?php
311 wpbc_open_meta_box_section( 'wpbc_form_field_free_generator', __('Form Field Configuration', 'booking') );
312
313 $this->fields_generator_section();
314
315 wpbc_close_meta_box_section();
316 ?>
317 </div>
318 </span>
319 </span>
320 <?php
321
322 // Content
323 ?>
324 <div class="clear" style="margin-bottom:10px;"></div>
325 <div class="metabox-holder">
326 <?php
327
328 // Get Form Fields
329 $booking_form_structure = wpbc_simple_form__db__get_visual_form_structure(); // Get saved or Import form fields from OLD Free version
330
331 $this->show_booking_form_fields_table( $booking_form_structure );
332 ?>
333 </div>
334 <div class="clear" style="height:10px;"></div>
335 <?php
336
337 }
338
339
340 public function content_section__form_layout(){
341
342 $default_options_values = wpbc_get_default_options();
343 ?><table class="form-table"><?php
344
345 $field_value_or_default = ( empty( get_bk_option( 'booking_form_structure_type' ) ) ? $default_options_values['booking_form_structure_type'] : get_bk_option( 'booking_form_structure_type' ) );
346
347 $field_options = array( // Associated array of titles and values
348 'optgroup_sf_s' => array(
349 'optgroup' => true
350 , 'close' => false
351 , 'title' => '&nbsp;' . __('Standard Forms' ,'booking')
352 )
353 // FixIn: 10.7.1.7.
354 , 'wizard_2columns' => array(
355 'title' => __('Wizard (several steps)', 'booking')
356 , 'id' => ''
357 , 'name' => ''
358 , 'style' => ''
359 , 'class' => ''
360 , 'disabled' => false
361 , 'selected' => false
362 , 'attr' => array()
363 )
364 , 'wizard_services_a' => array(
365 'title' => __( 'Wizard (Steps Timline)', 'booking' )
366 , 'id' => ''
367 , 'name' => ''
368 , 'style' => ''
369 , 'class' => ''
370 , 'disabled' => false
371 , 'selected' => false
372 , 'attr' => array()
373 )
374 , 'vertical' => array(
375 'title' => __('Form under calendar', 'booking')
376 , 'id' => ''
377 , 'name' => ''
378 , 'style' => ''
379 , 'class' => ''
380 , 'disabled' => false
381 , 'selected' => false
382 , 'attr' => array()
383 )
384 , 'form_right' => array(
385 'title' => __('Form at right side of calendar', 'booking')
386 , 'id' => ''
387 , 'name' => ''
388 , 'style' => ''
389 , 'class' => ''
390 , 'disabled' => false
391 , 'selected' => false
392 , 'attr' => array()
393 )
394 , 'form_center' => array(
395 'title' => __('Form and calendar are centered', 'booking')
396 , 'id' => ''
397 , 'name' => ''
398 , 'style' => ''
399 , 'class' => ''
400 , 'disabled' => false
401 , 'selected' => false
402 , 'attr' => array()
403 )
404
405 , 'optgroup_sf_e' => array( 'optgroup' => true, 'close' => true )
406 // , 'optgroup_help_tips_s' => array(
407 // 'optgroup' => true
408 // , 'close' => false
409 // , 'title' => '&nbsp;' . __('Advanced Forms' ,'booking')
410 // )
411 // , 'form_2_columns' => array(
412 // 'title' => __('2 Columns', 'booking')
413 // , 'id' => ''
414 // , 'name' => ''
415 // , 'style' => ''
416 // , 'class' => ''
417 // , 'disabled' => true
418 // , 'selected' => false
419 // , 'attr' => array()
420 // )
421 // , 'optgroup_help_tips_e' => array( 'optgroup' => true, 'close' => true )
422
423 );
424
425 WPBC_Settings_API::field_select_row_static( 'booking_form_structure_type__select'
426 , array(
427 'type' => 'select'
428 , 'title' => __('Form Layout', 'booking')
429 , 'label' => ''
430 , 'disabled' => false
431 , 'disabled_options' => array()
432 , 'multiple' => false
433
434 , 'description' => ''
435 , 'description_tag' => 'span'
436
437 , 'group' => 'form_layout'
438 , 'tr_class' => ''
439 , 'class' => ''
440 , 'css' => 'width:auto;max-width:100%;'
441 , 'only_field' => false
442 , 'attr' => array()
443
444 , 'value' => $field_value_or_default
445 , 'options' => $field_options
446 , 'attr' => array( 'onchange' => "javascript: if( 'wizard_2columns' === jQuery( this ).val() ) { jQuery( '#booking_form_layout_width' ).val( '100' ); jQuery( '#booking_form_layout_width_px_pr' ).val( '%' ); jQuery( '#booking_form_layout_max_cols' ).val( '2' ); } "
447 . " if( 'wizard_services_a' === jQuery( this ).val() ) { jQuery( '#booking_form_layout_width' ).val( '100' ); jQuery( '#booking_form_layout_width_px_pr' ).val( '%' ); jQuery( '#booking_form_layout_max_cols' ).val( '2' ); } "
448 . " if( 'vertical' === jQuery( this ).val() ) { jQuery( '#booking_form_layout_max_cols' ).val( '2' ); jQuery( '#booking_form_layout_width' ).val( '100' ); jQuery( '#booking_form_layout_width_px_pr' ).val( '%' ); } "
449 . " if( 'form_right' === jQuery( this ).val() ) { jQuery( '#booking_form_layout_max_cols' ).val( '1' ); jQuery( '#booking_form_layout_width' ).val( '440' ); jQuery( '#booking_form_layout_width_px_pr' ).val( 'px' ); } "
450 . " if( 'form_center' === jQuery( this ).val() ) { jQuery( '#booking_form_layout_max_cols' ).val( '1' ); jQuery( '#booking_form_layout_width' ).val( '440' ); jQuery( '#booking_form_layout_width_px_pr' ).val( 'px' ); } "
451 )
452 )
453 );
454
455
456 $field_value_or_default = ( empty( get_bk_option( 'booking_form_layout_max_cols' ) ) ? $default_options_values['booking_form_layout_max_cols'] : get_bk_option( 'booking_form_layout_max_cols' ) );
457 WPBC_Settings_API::field_select_row_static( 'booking_form_layout_max_cols'
458 , array(
459 'type' => 'select'
460 , 'title' => __( 'Columns', 'booking' )
461 , 'label' => ''
462 , 'disabled' => false
463 , 'disabled_options' => array()
464 , 'multiple' => false
465
466 , 'description' => __('Set number of columns in booking form','booking')
467 , 'description_tag' => 'span'
468
469 , 'group' => 'form_layout'
470 , 'tr_class' => ''
471 , 'class' => ''
472 , 'css' => 'width:auto;max-width:100%;'
473 , 'only_field' => false
474 , 'attr' => array()
475
476 , 'value' => $field_value_or_default
477 , 'options' => array( 1 => 1, 2 => 2, 3 => 3 )
478 //, 'attr' => array( 'onchange' => "javascript: if( 'wizard_2columns' === jQuery( this ).val() ) { jQuery( '#booking_form_layout_width' ).val( '100' ); jQuery( '#booking_form_layout_width_px_pr' ).find( 'option' ).prop( 'selected', false ); jQuery( '#booking_form_layout_width_px_pr' ).val( '%' ); } " )
479 )
480 );
481
482
483 $id = 'booking_form_layout';
484 ?><tr class="wpbc_tr_<?php echo esc_attr( $id ); ?>_size__select">
485 <th scope="row" style="vertical-align: middle;">
486 <label for="wpbc_booking_width" class="wpbc-form-text"><?php esc_html_e('Form Width:', 'booking'); ?></label>
487 </th>
488 <td class=""><fieldset style="display: flex;flex-flow: row wrap;justify-content: flex-start;align-items: center;"><?php
489
490 $field_name = $id . '_width'; // 100
491 WPBC_Settings_API::field_text_row_static( $field_name
492 , array(
493 'type' => 'text'
494 , 'placeholder' => '100'
495 , 'class' => ''
496 , 'css' => 'width:5em;'
497 , 'only_field' => true
498 , 'attr' => array()
499 , 'value' => ( empty( get_bk_option( $field_name ) ) ? $default_options_values[ $field_name ] : get_bk_option( $field_name ) )
500 )
501 );
502 $field_name = $id . '_width_px_pr'; // %
503 WPBC_Settings_API::field_select_row_static( $field_name
504 , array(
505 'type' => 'select'
506 , 'multiple' => false
507 , 'class' => ''
508 , 'css' => 'width:4em;'
509 , 'only_field' => true
510 , 'attr' => array()
511 , 'options' => array( 'px' => 'px', '%' => '%' )
512 , 'value' => ( empty( get_bk_option( $field_name ) ) ? $default_options_values[ $field_name ] : get_bk_option( $field_name ) )
513 )
514 );
515 ?><span class="description"> <?php esc_html_e('Set width of calendar' ,'booking'); ?></span></fieldset></td>
516 </tr><?php
517
518
519 ?></table>
520 <script type="text/javascript">
521 jQuery('select[name=\"booking_form_structure_type__select\"]').on( 'change', function(){
522 var selected_val = jQuery('#booking_form_structure_type__select').val();
523 jQuery('#booking_form_structure_type').val( selected_val );
524 } );
525 </script><?php
526 }
527
528
529 public function content_section__form_color_theme(){
530
531 $default_options_values = wpbc_get_default_options();
532
533 ?><table class="form-table"><?php
534
535 $field_name = 'booking_form_theme';
536 $field_params = array(
537 'type' => 'select'
538 , 'default' => $default_options_values[ $field_name ] //'Off'
539 , 'title' => __('Color Theme' ,'booking')
540 , 'description' => __('Select a color theme for your booking form that matches the look of your website.' ,'booking')
541 // . '<div class="wpbc-general-settings-notice wpbc-settings-notice notice-info">'
542 // . __('When you select a color theme, it also change the calendar and time-slot picker skins to match your choice. Customize these options separately as needed.' ,'booking')
543 // .'</div>'
544 , 'options' => array(
545 '' => __( 'Light', 'booking' ),
546 'wpbc_theme_dark_1' => __( 'Dark', 'booking' )
547 )
548 , 'group' => 'form'
549 , 'value' => ( empty( get_bk_option( $field_name ) ) ? $default_options_values[ $field_name ] : get_bk_option( $field_name ) ),
550 'attr' => array( 'onchange' => "javascript: wpbc_on_change__form_color_theme( this );" )
551
552 );
553
554 WPBC_Settings_API::field_select_row_static( $field_name, $field_params );
555
556 ?></table><?php
557 ?><script type="text/javascript">
558 function wpbc_on_change__form_color_theme( _this ){
559 var wpbc_cal_dark_skin_path;
560 if ( 'wpbc_theme_dark_1' == jQuery( _this ).val() ){
561 jQuery( '.wpbc_center_preview,.wpbc_container.wpbc_container_booking_form' ).addClass( 'wpbc_theme_dark_1' );
562 wpbc_cal_dark_skin_path = '<?php echo esc_url( WPBC_PLUGIN_URL ); ?>/css/skins/24_9__dark_1.css';
563 jQuery( '#ui_btn_cstm__set_calendar_skin' ).find( 'option' ).prop( 'selected', false );
564 jQuery( '#ui_btn_cstm__set_calendar_skin' ).find( 'option[value="' + wpbc_cal_dark_skin_path + '"]' ).prop( 'selected', true ).trigger( 'change' );
565 wpbc_cal_dark_skin_path = '<?php echo esc_url( WPBC_PLUGIN_URL ); ?>/css/time_picker_skins/black.css';
566 jQuery( '#ui_btn_cstm__set_time_picker_skin' ).find( 'option' ).prop( 'selected', false );
567 jQuery( '#ui_btn_cstm__set_time_picker_skin' ).find( 'option[value="' + wpbc_cal_dark_skin_path + '"]' ).prop( 'selected', true ).trigger( 'change' );
568 } else {
569 jQuery( '.wpbc_center_preview,.wpbc_container.wpbc_container_booking_form' ).removeClass( 'wpbc_theme_dark_1' );
570 wpbc_cal_dark_skin_path = '<?php echo esc_url( WPBC_PLUGIN_URL ); ?>/css/skins/24_9__light_square_1.css';
571 jQuery( '#ui_btn_cstm__set_calendar_skin' ).find( 'option' ).prop( 'selected', false );
572 jQuery( '#ui_btn_cstm__set_calendar_skin' ).find( 'option[value="' + wpbc_cal_dark_skin_path + '"]' ).prop( 'selected', true ).trigger( 'change' );
573 wpbc_cal_dark_skin_path = '<?php echo esc_url( WPBC_PLUGIN_URL ); ?>/css/time_picker_skins/light__24_8.css';
574 jQuery( '#ui_btn_cstm__set_time_picker_skin' ).find( 'option' ).prop( 'selected', false );
575 jQuery( '#ui_btn_cstm__set_time_picker_skin' ).find( 'option[value="' + wpbc_cal_dark_skin_path + '"]' ).prop( 'selected', true ).trigger( 'change' );
576 }
577 }
578 </script><?php
579 }
580
581
582 public function content_section__calendar_skin(){
583
584 ?><script type="text/javascript">
585 jQuery( document ).ready( function (){
586
587 // Calendar skin
588 var template__var = wp.template( 'wpbc_ajx_widget_change_calendar_skin' );
589
590 jQuery( '.wpbc_widget_color_skins .ui_container' ).append(
591
592 template__var({ 'ajx_cleaned_params': {
593 'customize_plugin__booking_skin': '<?php echo esc_js( get_bk_option( 'booking_skin' ) ); ?>',
594 }
595 })
596 );
597 } );
598 </script><?php
599 }
600
601
602 public function content_section__time_picker_skin(){
603
604 ?><script type="text/javascript">
605 jQuery( document ).ready( function (){
606 // Time Picker
607 var template__var = wp.template( 'wpbc_ajx_widget_change_time_picker' );
608
609 jQuery( '.wpbc_widget_color_skins .ui_container' ).append(
610
611 template__var({ 'ajx_cleaned_params': {
612 'customize_plugin__time_picker_skin': '<?php echo esc_js( get_bk_option( 'booking_timeslot_picker_skin' ) ); ?>'
613 }
614 })
615 );
616 } );
617 </script><?php
618 }
619
620
621 public function content_section__form_options(){
622
623 $default_options_values = wpbc_get_default_options();
624
625 ?><table class="form-table"><?php
626
627 $field_name = 'booking_is_use_autofill_4_logged_user';
628 $field_params = array(
629 'type' => 'checkbox'
630 , 'default' => $default_options_values[ $field_name ] //'Off'
631 , 'title' => __('Auto-fill fields' ,'booking')
632 , 'label' => __('Check the box to activate auto-fill form fields for logged in users.' ,'booking')
633 , 'description' => ''
634 , 'group' => 'form'
635 , 'value' => ( empty( get_bk_option( $field_name ) ) ? $default_options_values[ $field_name ] : get_bk_option( $field_name ) )
636 );
637 WPBC_Settings_API::field_checkbox_row_static( $field_name, $field_params );
638
639
640 $field_name = 'booking_timeslot_picker';
641 $field_params = array(
642 'type' => 'checkbox'
643 , 'default' => $default_options_values[ $field_name ] //'Off'
644 , 'title' => __('Time picker for time slots' ,'booking')
645 , 'label' => __('Show time slots as a time picker instead of a select box.' ,'booking')
646 , 'description' => ''
647 , 'group' => 'time_slots'
648 , 'tr_class' => 'wpbc_timeslot_picker'
649 , 'value' => ( empty( get_bk_option( $field_name ) ) ? $default_options_values[ $field_name ] : get_bk_option( $field_name ) )
650 );
651 WPBC_Settings_API::field_checkbox_row_static( $field_name, $field_params );
652
653 ?></table><?php
654
655 ?><div style="display: flex;flex-flow: row wrap;justify-content: flex-end;align-items: center;font-size: 10px;">
656 <div style="margin-right: 1em;font-weight: 600;"><?php esc_html_e('Global Settings','booking'); ?>: </div>
657 <i style="margin-right: 5px;<?php echo ( get_bk_option( 'booking_is_use_captcha' ) === 'On' ) ? 'color: #036aab' : ''; ?>"
658 class="wpbc_set_nav__right_icon menu_icon icon-1x <?php echo ( get_bk_option( 'booking_is_use_captcha' ) === 'On' ) ? 'wpbc-bi-toggle2-on wpbc_set_nav__icon_on' : 'wpbc-bi-toggle2-off'; ?>"
659 ></i><a href="<?php echo esc_url( wpbc_get_settings_url() ) . '&tab=form&subtab=form_options#do_expand__wpbc_general_settings_form_metabox#do_other_actions__blink_captcha'; ?>">
660 <span ><?php
661 esc_html_e( 'CAPTCHA', 'booking' );
662 echo ' ';
663 echo esc_html( get_bk_option( 'booking_is_use_captcha' ) );
664 ?></span>
665 </a>
666 </div><?php
667 }
668
669
670 private function help_notice__show_time_fields_once() {
671
672 ?>
673 <div class="wpbc-settings-notice notice-error notice-helpful-info0" style="margin: 0 0 30px;">
674 <?php
675 echo '<strong>';
676 esc_html_e( 'Error', 'booking' );
677 echo '!</strong>&nbsp;&nbsp;';
678
679 /* translators: 1: ... */
680 echo wp_kses_post( __( 'You can either use the time slots field or the start time and duration time fields, but not both. If you choose to use the start time and duration time fields, make sure to use them together.', 'booking' ) );
681 ?>
682 </div>
683 <?php
684 }
685
686 private function help_notice__show_missed_time_fields() {
687
688 ?>
689 <div class="wpbc-settings-notice notice-error notice-helpful-info0" style="margin: 0 0 30px;">
690 <?php
691 echo '<strong>';
692 esc_html_e( 'Error', 'booking' );
693 echo '!</strong>&nbsp;&nbsp;';
694
695 /* translators: 1: ... */
696 echo wp_kses_post( __( 'You must use both the start time field and the duration time field together.', 'booking' ) );
697 ?>
698 </div>
699 <?php
700 }
701
702 private function is_exist_duplicated_time_fields( $visual_form_structure ) {
703
704 $time_fields_arr = array();
705 foreach ( $visual_form_structure as $field_arr ) {
706 if (
707 ( isset( $field_arr['active'] ) ) &&
708 ( isset( $field_arr['name'] ) ) &&
709 ( 'on' === strtolower( $field_arr['active'] ) ) &&
710 ( in_array( $field_arr['name'], array(
711 'rangetime',
712 'durationtime',
713 'starttime',
714 'endtime',
715 ), true ) ) ) {
716 $time_fields_arr[] = $field_arr['name'];
717 }
718 }
719
720 if ( in_array( 'rangetime', $time_fields_arr, true ) ) {
721
722 if ( count( $time_fields_arr ) > 1 ) {
723 return 'duplicated_time_fields';
724 }
725
726 } else {
727
728 if ( count( $time_fields_arr ) === 1 ) {
729 return 'missed_time_fields';
730 }
731 }
732
733 return 'ok';
734 }
735
736 /**
737 * Show Fields Table */
738 private function show_booking_form_fields_table( $booking_form_structure ) {
739
740 $booking_form_structure = maybe_unserialize( $booking_form_structure );
741
742 $skip_obligatory_field_types =array();// array( 'calendar', 'submit', 'captcha' );
743
744 $obligatory_field_types = array( 'calendar', 'submit', 'email' );
745 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) {
746 $obligatory_field_types[] = 'captcha';
747 }
748
749
750 if ( 'duplicated_time_fields' === $this->is_exist_duplicated_time_fields( $booking_form_structure ) ) {
751 $this->help_notice__show_time_fields_once();
752 }
753 if ( 'missed_time_fields' === $this->is_exist_duplicated_time_fields( $booking_form_structure ) ) {
754 $this->help_notice__show_missed_time_fields();
755 }
756
757 ?><table class="widefat wpbc_input_table sortable wpdevelop wpbc_table_form_free" cellspacing="0" cellpadding="0"> <?php //FixIn: 10.1.2.2 style="flex:0 1 49.9%;"> ?>
758 <thead>
759 <tr>
760 <th class="sort"><span class="wpbc_icn_swap_vert" aria-hidden="true"></span></th>
761 <th class="field_active"><?php echo esc_js( __('Active', 'booking') ); ?></th>
762 <th class="field_label"><?php echo esc_js( __('Field Label', 'booking') ); ?></th>
763 <th class="field_required"><?php echo esc_js( __('Required', 'booking') ); ?></th>
764 <!--th class="field_options"><?php echo esc_js( __('Type', 'booking') ) . ' | ' . esc_js( __('Name', 'booking') ); ?></th-->
765 <th class="field_actions"><?php echo esc_js( __('Actions', 'booking') ); ?></th>
766 </tr>
767 </thead>
768 <tbody class="wpbc_form_fields_body">
769 <?php
770
771 $i=0;
772
773 foreach ( $booking_form_structure as $form_field ) {
774
775 $defaults = array(
776 'type' => 'text'
777 , 'name' => 'unique_name'
778 , 'obligatory' => 'Off'
779 , 'active' => 'On'
780 , 'required' => 'Off'
781 , 'label' => ''
782 , 'value' => ''
783 );
784 $form_field = wp_parse_args( $form_field, $defaults );
785
786 if( ! in_array( $form_field['type'], $skip_obligatory_field_types ) ) {
787
788 $i++;
789
790 $row = '<tr class="account">';
791
792 $row .= '<td class="sort"><span class="wpbc_icn_drag_indicator" aria-hidden="true"></span></td>';
793
794 // Flex Toggle
795 if ( 1 ) {
796 ob_start();
797 $is_checked = ( $form_field['active'] === 'On' );
798 $field_id = 'wpbc_on_off_' . 'active_' . intval( microtime( true ) ) . '_' . wp_rand( 1, 1000 );
799 $field_name = 'form_field_active[' . $i . ']';
800 $field_value = esc_attr( $form_field['active'] );
801 $params_checkbox = array(
802 'id' => $field_id // HTML ID of element
803 , 'name' => $field_name
804 , 'label' => array( 'title' => '', 'position' => 'right' )
805 , 'toggle_style' => '' // CSS of select element
806 , 'class' => 'wpbc_visible_but_out_screen ' // CSS Class of select element
807 , 'disabled' => ''
808 , 'attr' => array( 'autocomplete' => 'off' ) // Any additional attributes, if this radio | checkbox element
809 , 'legend' => '' //wp_kses_post( $field_title ) // aria-label parameter
810 , 'value' => $field_value // Some Value from options array that selected by default
811 , 'selected' => $is_checked // Selected or not
812 //, 'onchange' => "jQuery( this ).parents('.wpbc_searchable_on_off').find('.wpbc_label_on_off').hide();jQuery( this ).parents('.wpbc_searchable_on_off').find( jQuery( this ).is(':checked') ? '.wpbc_label_on' : '.wpbc_label_off' ).show();" // JavaScript code
813 //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code
814 //, 'hint' => array( 'title' => __('Send email notification to customer about this operation' ,'booking') , 'position' => 'top' )
815 );
816 wpbc_flex_toggle( $params_checkbox );
817 $flex_toggle = ob_get_clean();
818 }
819
820 $row .= '<td class="field_active"><div class="wpbc_align_vertically">'
821 . ( ( ( $form_field['obligatory'] != 'On' ) && ( ! in_array( $form_field['type'], $obligatory_field_types ) ) )
822 ? $flex_toggle
823 // ? '<input type="checkbox" name="form_field_active[' . $i . ']" value="' . esc_attr( $form_field['active'] ) . '" ' . checked( $form_field['active'], 'On' , false ) . ' autocomplete="off" />'
824 : '' )
825
826 .'</div></td>';
827 $row .= '<td class="field_label"><div class="wpbc_align_vertically">'
828 . '<legend class="screen-reader-text"><span>' . esc_attr( $form_field['label'] ) . '</span></legend>'
829 .'<input type="text"
830 name="form_field_label[' . $i . ']"
831 value="' . esc_attr( $form_field['label'] ) . '"
832 class="regular-text"
833 placeholder="' . ( ( $form_field['name'] == 'calendar' ) ? __( 'Select date(s)', 'booking' ) : esc_attr( $form_field['label'] ) ) . '"
834 autocomplete="off"
835 /> ';
836 if (
837 ( in_array( $form_field['name'], array( 'calendar', 'submit', 'captcha', 'rangetime', 'durationtime', 'starttime', 'endtime' ), true ) )
838 || ( in_array( $form_field['type'], array( 'calendar' ) ) )
839 ){
840 $css_label = 'wpbc_label_approved';
841 $css_label = (( $form_field['name'] == 'calendar' ) || ( $form_field['type'] == 'calendar' )) ? 'wpbc_label_deleted_resource' : $css_label;
842 $css_label = ( $form_field['name'] == 'submit' ) ? 'wpbc_label_resource' : $css_label;
843 $css_label = ( $form_field['name'] == 'captcha' ) ? 'wpbc_label_pending' : $css_label;
844 $css_label = ( in_array( $form_field['name'], array( 'rangetime', 'durationtime', 'starttime', 'endtime' ), true ) ) ? 'wpbc_label_approved' : $css_label;
845
846 $row .= '<div class="field_type_name_description"><div class="field_type_name_value wpbc_label '.$css_label.'" style="text-transform: uppercase;padding: 0 1em;">';
847
848 if ( ( $form_field['name'] == 'calendar' ) ||
849 ( $form_field['type'] == 'calendar' ) ) { $row .= __( 'Calendar', 'booking' );
850 } else if ( $form_field['name'] == 'rangetime' ) { $row .= __( 'Time Slots', 'booking' );
851 } else if ( $form_field['name'] == 'durationtime' ) { $row .= __( 'Duration Time', 'booking' ) . ' / ' . __( 'Service Duration', 'booking' );
852 } else if ( $form_field['name'] == 'starttime' ) { $row .= __( 'Start Time', 'booking' );
853 } else if ( $form_field['name'] == 'endtime' ) { $row .= __( 'End Time', 'booking' );
854 } else if ( $form_field['name'] == 'submit' ) { $row .= $form_field['name'] . ' ' . __( 'Button', 'booking' );
855 } else { $row .= $form_field['name'];
856 }
857 $row .= '</div></div>';
858 } else {
859 $row .= '<div class="field_type_name_description">
860 ' . __( 'Type', 'booking' ) . ': <div class="field_type_name_value">' . $form_field['type'] . '</div>
861 <span class="field_type_name_separator">|</span>
862 ' . __( 'Name', 'booking' ) . ': <div class="field_type_name_value">' . $form_field['name'] . '</div>
863 </div>';
864 }
865 $row .= '<input type="hidden" value="'. esc_attr( ( 'select' == $form_field['type'] ) ? 'selectbox' : $form_field['type'] ) . '" name="form_field_type[' . $i . ']" autocomplete="off" />'
866 . '<input type="hidden" value="'. esc_attr( $form_field['name'] ) . '" name="form_field_name[' . $i . ']" autocomplete="off" />'
867 . '<input type="hidden" value="'. esc_attr( $form_field['value'] ) . '" name="form_field_value[' . $i . ']" autocomplete="off" />'
868 .'</div></td>';
869
870 //FixIn: TimeFreeGenerator
871 $is_show_required_checkbox = true;
872 if ( ( $form_field['obligatory'] == 'On' ) || ( in_array( $form_field['type'], $obligatory_field_types ) ) ) {
873 $is_show_required_checkbox = false;
874 }
875 if ( isset( $form_field['if_exist_required'] ) && ( $form_field['if_exist_required'] == 'On' ) ) {
876 $is_show_required_checkbox = false;
877 }
878
879 // Flex Toggle
880 if ( 1 ) {
881 ob_start();
882 $is_checked = ( $form_field['required'] === 'On' );
883 $field_id = 'wpbc_on_off_' . 'required_' . intval( microtime( true ) ) . '_' . wp_rand( 1, 1000 );
884 $field_name = 'form_field_required[' . $i . ']';
885 $field_value = esc_attr( $form_field['required'] );
886 $params_checkbox = array(
887 'id' => $field_id // HTML ID of element
888 , 'name' => $field_name
889 , 'label' => array( 'title' => '', 'position' => 'right' )
890 , 'toggle_style' => '' // CSS of select element
891 , 'class' => 'wpbc_visible_but_out_screen ' // CSS Class of select element
892 , 'disabled' => ''
893 , 'attr' => array( 'autocomplete' => 'off' ) // Any additional attributes, if this radio | checkbox element
894 , 'legend' => '' //wp_kses_post( $field_title ) // aria-label parameter
895 , 'value' => $field_value // Some Value from options array that selected by default
896 , 'selected' => $is_checked // Selected or not
897 //, 'onchange' => "jQuery( this ).parents('.wpbc_searchable_on_off').find('.wpbc_label_on_off').hide();jQuery( this ).parents('.wpbc_searchable_on_off').find( jQuery( this ).is(':checked') ? '.wpbc_label_on' : '.wpbc_label_off' ).show();" // JavaScript code
898 //, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).is(':checked') , 'in element:' , jQuery( this ) );" // JavaScript code
899 //, 'hint' => array( 'title' => __('Send email notification to customer about this operation' ,'booking') , 'position' => 'top' )
900 );
901 wpbc_flex_toggle( $params_checkbox );
902 $flex_toggle = ob_get_clean();
903 }
904 $row .= '<td class="field_required"><div class="wpbc_align_vertically">'
905 . ( $is_show_required_checkbox ? $flex_toggle : '' )
906 // ( $is_show_required_checkbox ? '<input type="checkbox" name="form_field_required[' . $i . ']" value="' . esc_attr( $form_field['required'] ) . '" ' . checked( $form_field['required'], 'On' , false ) . ' autocomplete="off" />' : '' )
907 .'</div></td>';
908 // $row .= '<td class="field_options"><div class="wpbc_align_vertically">'
909 // . '<input type="text" disabled="DISABLED" value="'. '' . $form_field['type']. ' | ' . $form_field['name'] . '" autocomplete="off" />'
910 // .'</div></td>';
911 $row .= '<td class="field_actions">';
912 if ( ( $form_field['obligatory'] != 'On' ) && ( ! in_array( $form_field['type'], array( 'captcha' ) ) ) ) {
913 //TODO: refactor here: 2024-05-31 23:15
914 $row .= '<a href="javascript:void(0)" onclick="javascript:wpbc_start_edit_form_field(' . $i . ');" class="tooltip_top button-secondary button" title="'.__('Edit' ,'booking').'"><i class="wpbc_icn_draw"></i></a>';
915 $row .= '<a href="javascript:void(0)" class="tooltip_top button-secondary button delete_bk_link" title="'.__('Remove' ,'booking').'"><i class="wpbc_icn_close"></i></a>';
916 //TODO: refactor here: 2024-05-31 23:15
917 /*
918 ob_start();
919 ?>
920 <div class="wpbc_ajx_toolbar wpbc_no_background" style="margin:0;">
921 <div class="ui_container ui_container_small">
922 <div class="ui_group ui_group__search_url">
923 <?php
924 wpbc_ajx__ui__all_or_new( array(), array('wh_what_bookings'=>'new') );
925
926 echo '<div class="ui_element" style="margin:0 5px 0 -10px"><a href="javascript:void(0)" onclick="javascript:wpbc_start_edit_form_field(' . $i . ');" class="wpbc_ui_control wpbc_ui_button wpbc_ui_button tooltip_top " title="'.__('Edit' ,'booking').'"><i class="wpbc_icn_draw"></i></a></div>';
927 echo '<div class="ui_element"><a href="javascript:void(0)" class="wpbc_ui_control wpbc_ui_button wpbc_ui_button tooltip_top button delete_bk_link" title="'.__('Remove' ,'booking').'"><i class="wpbc_icn_close"></i></a></div>';
928
929 ?></div></div></div><?php
930 $elemnt = ob_get_clean();
931 $row .= $elemnt;
932 */
933 }
934 $row .= '</td>';
935
936 $row .= '</tr>';
937 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
938 echo $row;
939 }
940 }
941
942 ?>
943 </tbody>
944 <?php /* ?>
945 <tfoot>
946 <tr>
947 <th colspan="6">
948 <a href="#" class="remove_rows button"><?php esc_html_e( 'Remove selected field' ,'booking'); ?></a>
949 </th>
950 </tr>
951 </tfoot>
952 <?php /**/ ?>
953 </table><?php
954
955
956 }
957
958
959 /** CSS for this page */
960 private function css() {
961 ?>
962 <style type="text/css">
963 /* toolbar fix */
964 .wpdevelop .visibility_container .control-group {
965 margin: 2px 8px 3px 0; /* margin: 0 8px 5px 0; */ /* FixIn: 9.5.4.8 */
966 }
967 /* Selectbox element in toolbar */
968 .visibility_container select optgroup{
969 color:#999;
970 vertical-align: middle;
971 font-style: italic;
972 font-weight: 400;
973 }
974 .visibility_container select option {
975 padding:5px;
976 font-weight: 600;
977 }
978 .visibility_container select optgroup option{
979 padding: 5px 20px;
980 color:#555;
981 font-weight: 600;
982 }
983 #wpbc_create_new_custom_form_name_fields {
984 width: 360px;
985 display:none;
986 }
987 @media (max-width: 399px) {
988 #wpbc_create_new_custom_form_name_fields {
989 width: 100%;
990 }
991 }
992 </style>
993 <?php
994 wpbc_timeslots_free_css(); //FixIn: TimeFreeGenerator
995 }
996
997
998 // -----------------------------------------------------------------------------------------------------------------
999 // Generators
1000 // -----------------------------------------------------------------------------------------------------------------
1001 /** Sections with Add New Fields forms */
1002 private function fields_generator_section() {
1003 ?>
1004 <div class="wpbc_field_generator wpbc_field_generator_info">
1005 <?php
1006
1007 echo
1008 '<p><strong>' . esc_html__('Shortcodes' ,'booking') . '.</strong> '
1009 . wp_kses_post( sprintf(__('You can generate the form fields for your form (at the left side) by selection specific field in the above selectbox.' ,'booking'),'<code><strong>[email* email]</strong></code>'))
1010 /* translators: 1: ... */
1011 .'<br/>' . wp_kses_post( sprintf( __( 'Please read more about the booking form fields configuration %1$shere%2$s.', 'booking' ),'<a href="https://wpbookingcalendar.com/faq/booking-form-fields/" target="_blank">', '</a>') )
1012
1013 . '</p><p><strong>' . esc_html__('Default Form Templates' ,'booking') . '.</strong> ' .
1014 /* translators: 1: ... */
1015 wp_kses_post( sprintf( __( 'You can reset your active form template by selecting default %1$sform template%2$s at the top toolbar. Please select the form template and click on %3$sReset%4$s button for resetting only active form (Booking Form or Content of Booking Fields form). Click on %5$sBoth%6$s button if you want to reset both forms: Booking Form and Content of Booking Fields form.', 'booking' )
1016 ,'<strong>','</strong>'
1017 ,'<strong>','</strong>'
1018 ,'<strong>','</strong>'
1019 ) )
1020 .'</p>';
1021 ?>
1022 </div>
1023 <div class="wpbc_field_generator wpbc_field_generator_text">
1024 <?php
1025
1026 $this->generate_field(
1027 'text_field_generator'
1028 , array(
1029 'active' => true
1030 , 'required' => true
1031 , 'label' => true
1032 , 'name' => true
1033 , 'value' => false
1034 , 'type' => 'text'
1035 )
1036 );
1037 ?>
1038 </div>
1039 <div class="wpbc_field_generator wpbc_field_generator_textarea">
1040 <?php
1041
1042 $this->generate_field(
1043 'textarea_field_generator'
1044 , array(
1045 'active' => true
1046 , 'required' => true
1047 , 'label' => true
1048 , 'name' => true
1049 , 'value' => false
1050 , 'type' => 'textarea'
1051 )
1052 );
1053 ?>
1054 </div>
1055 <div class="wpbc_field_generator wpbc_field_generator_select wpbc_field_generator_selectbox">
1056 <?php
1057 $this->generate_field(
1058 'selectbox_field_generator'
1059 , array(
1060 'active' => true
1061 , 'required' => true
1062 , 'label' => true
1063 , 'name' => true
1064 , 'value' => true
1065 , 'type' => 'selectbox'
1066 )
1067 );
1068 ?>
1069 </div>
1070 <div class="wpbc_field_generator wpbc_field_generator_checkbox">
1071 <?php
1072
1073 $this->generate_field(
1074 'checkbox_field_generator'
1075 , array(
1076 'active' => true
1077 , 'required' => true
1078 , 'label' => true
1079 , 'name' => true
1080 , 'value' => false
1081 , 'type' => 'checkbox'
1082 )
1083 );
1084 ?>
1085 </div>
1086 <?php
1087 //FixIn: TimeFreeGenerator
1088 ?>
1089 <div class="wpbc_field_generator wpbc_field_generator_rangetime">
1090 <?php
1091
1092 $this->generate_field(
1093 'rangetime_field_generator'
1094 , array(
1095 'active' => true
1096 , 'required' => true
1097 , 'label' => true
1098 , 'name' => true
1099 , 'value' => true
1100 , 'type' => 'selectbox'
1101
1102 , 'required_attr' => array( 'disabled' => true
1103 , 'value' => 'On'
1104 )
1105 , 'label_attr' => array( 'placeholder' => __( 'Time Slots', 'booking' )
1106 , 'value' => __( 'Time Slots', 'booking' )
1107 )
1108 , 'name_attr' => array( 'disabled' => true
1109 , 'placeholder' => 'rangetime'
1110 , 'value' => 'rangetime'
1111 )
1112 , 'value_attr' => array( 'value' => "10:00 AM - 12:00 PM@@10:00 - 12:00\n12:00 PM - 02:00 PM@@12:00 - 14:00\n13:00 - 14:00\n11:00 - 15:00\n14:00 - 16:00\n16:00 - 18:00\n18:00 - 20:00"
1113 , 'attr' => array(
1114 'placeholder' => "10:00 AM - 12:00 PM@@10:00 - 12:00\n12:00 PM - 02:00 PM@@12:00 - 14:00\n13:00 - 14:00\n11:00 - 15:00\n14:00 - 16:00\n16:00 - 18:00\n18:00 - 20:00"
1115 )
1116 , 'rows' => 8
1117 , 'cols' => 37
1118 )
1119 )
1120 );
1121 ?>
1122 </div>
1123 <?php
1124
1125 // FixIn: 10.10.1.4.
1126 ?>
1127 <div class="wpbc_field_generator wpbc_field_generator_durationtime">
1128 <?php
1129 // __( 'Start Time', 'booking' ) . ' / ' . __( 'Duration Time', 'booking' ), .
1130 $this->generate_field(
1131 'durationtime_field_generator',
1132 array(
1133 'active' => true,
1134 'required' => true,
1135 'label' => true,
1136 'name' => true,
1137 'value' => true,
1138 'type' => 'selectbox',
1139 'required_attr' => array(
1140 'disabled' => true,
1141 'value' => 'On',
1142 ),
1143 'label_attr' => array(
1144 'placeholder' => __( 'Duration Time', 'booking' ),
1145 'value' => __( 'Duration Time', 'booking' ),
1146 ),
1147 'name_attr' => array(
1148 'disabled' => true,
1149 'placeholder' => 'durationtime',
1150 'value' => 'durationtime',
1151 ),
1152 'value_attr' => array(
1153 'value' => "Service A (15 min)@@00:15\nService B (20 min)@@00:20\nService C (30 min)@@00:30\nService D (1 hour)@@01:00\nService E (2 hours)@@02:00",
1154 'attr' => array(
1155 'placeholder' => "Service A (15 min)@@00:15\nService B (20 min)@@00:20\nService C (30 min)@@00:30\nService D (1 hour)@@01:00\nService E (2 hours)@@02:00",
1156 ),
1157 'rows' => 8,
1158 'cols' => 37,
1159 ),
1160 )
1161 );
1162 ?>
1163 </div>
1164 <?php
1165
1166
1167 // FixIn: 10.10.1.5.
1168 ?>
1169 <div class="wpbc_field_generator wpbc_field_generator_starttime">
1170 <?php
1171 // __( 'Start Time', 'booking' ) . ' / ' . __( 'Duration Time', 'booking' ), .
1172 $this->generate_field(
1173 'starttime_field_generator',
1174 array(
1175 'active' => true,
1176 'required' => true,
1177 'label' => true,
1178 'name' => true,
1179 'value' => true,
1180 'type' => 'selectbox',
1181 'required_attr' => array(
1182 'disabled' => true,
1183 'value' => 'On',
1184 ),
1185 'label_attr' => array(
1186 'placeholder' => __( 'Start Time', 'booking' ),
1187 'value' => __( 'Start Time', 'booking' ),
1188 ),
1189 'name_attr' => array(
1190 'disabled' => true,
1191 'placeholder' => 'starttime',
1192 'value' => 'starttime',
1193 ),
1194 'value_attr' => array(
1195 'value' => "10:00 AM@@10:00\n10:30 AM@@10:30\n11:00 AM@@11:00\n11:30 AM@@11:30\n12:00 PM@@12:00\n12:30 PM@@12:30\n1:00 PM@@13:00\n1:30 PM@@13:30\n2:00 PM@@14:00\n2:30 PM@@14:30\n3:00 PM@@15:00\n3:30 PM@@15:30\n4:00 PM@@16:00\n4:30 PM@@16:30\n5:00 PM@@17:00\n5:30 PM@@17:30\n6:00 PM@@18:00",
1196 'attr' => array(
1197 'placeholder' => "10:00 AM@@10:00\n10:30 AM@@10:30\n11:00 AM@@11:00\n11:30 AM@@11:30\n12:00 PM@@12:00\n12:30 PM@@12:30\n1:00 PM@@13:00\n1:30 PM@@13:30\n2:00 PM@@14:00\n2:30 PM@@14:30\n3:00 PM@@15:00\n3:30 PM@@15:30\n4:00 PM@@16:00\n4:30 PM@@16:30\n5:00 PM@@17:00\n5:30 PM@@17:30\n6:00 PM@@18:00",
1198 ),
1199 'rows' => 8,
1200 'cols' => 37,
1201 ),
1202 )
1203 );
1204 ?>
1205 </div>
1206 <?php
1207
1208
1209 // FixIn: 10.10.1.5.
1210 ?>
1211 <div class="wpbc_field_generator wpbc_field_generator_endtime">
1212 <?php
1213 // __( 'Start Time', 'booking' ) . ' / ' . __( 'Duration Time', 'booking' ), .
1214 $this->generate_field(
1215 'endtime_field_generator',
1216 array(
1217 'active' => true,
1218 'required' => true,
1219 'label' => true,
1220 'name' => true,
1221 'value' => true,
1222 'type' => 'selectbox',
1223 'required_attr' => array(
1224 'disabled' => true,
1225 'value' => 'On',
1226 ),
1227 'label_attr' => array(
1228 'placeholder' => __( 'End Time', 'booking' ),
1229 'value' => __( 'End Time', 'booking' ),
1230 ),
1231 'name_attr' => array(
1232 'disabled' => true,
1233 'placeholder' => 'endtime',
1234 'value' => 'endtime',
1235 ),
1236 'value_attr' => array(
1237 'value' => "10:00 AM@@10:00\n10:30 AM@@10:30\n11:00 AM@@11:00\n11:30 AM@@11:30\n12:00 PM@@12:00\n12:30 PM@@12:30\n1:00 PM@@13:00\n1:30 PM@@13:30\n2:00 PM@@14:00\n2:30 PM@@14:30\n3:00 PM@@15:00\n3:30 PM@@15:30\n4:00 PM@@16:00\n4:30 PM@@16:30\n5:00 PM@@17:00\n5:30 PM@@17:30\n6:00 PM@@18:00",
1238 'attr' => array(
1239 'placeholder' => "10:00 AM@@10:00\n10:30 AM@@10:30\n11:00 AM@@11:00\n11:30 AM@@11:30\n12:00 PM@@12:00\n12:30 PM@@12:30\n1:00 PM@@13:00\n1:30 PM@@13:30\n2:00 PM@@14:00\n2:30 PM@@14:30\n3:00 PM@@15:00\n3:30 PM@@15:30\n4:00 PM@@16:00\n4:30 PM@@16:30\n5:00 PM@@17:00\n5:30 PM@@17:30\n6:00 PM@@18:00",
1240 ),
1241 'rows' => 8,
1242 'cols' => 37,
1243 ),
1244 )
1245 );
1246 ?>
1247 </div>
1248 <?php
1249
1250
1251 // Close button.
1252 ?>
1253 <div class="wpbc_field_generator wpbc_field_generator_info_advanced">
1254 <div class="clear" style="margin-top:20px;"></div>
1255 <a onclick="javascript:wpbc_hide_fields_generators();" href="javascript:void(0)" style="margin: 0 15px;" class="button button"><i class="menu_icon icon-1x wpbc_icn_visibility_off"></i>&nbsp;
1256 <?php
1257 esc_html_e( 'Close', 'booking' );
1258 ?>
1259 </a>
1260 </div>
1261 <?php
1262 }
1263
1264
1265
1266 /**
1267 * General Fields Generator
1268 *
1269 * @param $field_name
1270 * @param $field_options
1271 *
1272 * @return void
1273 */
1274 private function generate_field( $field_name = 'some_field_name', $field_options = array() ) {
1275
1276 $defaults = array(
1277 'active' => true
1278 , 'required' => true
1279 , 'label' => true
1280 , 'name' => true
1281 , 'value' => true
1282 //FixIn: TimeFreeGenerator (inside of form fields edited, as well)
1283 , 'required_attr' => array( 'disabled' => false
1284 , 'value' => 'Off'
1285 )
1286 , 'label_attr' => array( 'placeholder' => __('First Name', 'booking')
1287 , 'value' => ''
1288 )
1289 , 'name_attr' => array( 'disabled' => false
1290 , 'placeholder' => 'first_name'
1291 , 'value' => ''
1292 )
1293 , 'value_attr' => array( 'value' => ''
1294 , 'attr' => array( 'placeholder' => "1\n2\n3\n4" )
1295 , 'rows' => 8
1296 , 'cols' => 37
1297 )
1298 );
1299 $field_options = wp_parse_args( $field_options, $defaults );
1300
1301 ?><table class="form-table"><?php
1302
1303 if ( $field_options['active'] )
1304 WPBC_Settings_API::field_checkbox_row_static( $field_name . '_active'
1305 , array(
1306 'type' => 'checkbox'
1307 , 'title' => __('Active', 'booking')
1308 , 'label' => __('Show / hide field in booking form', 'booking')
1309 , 'disabled' => false
1310 , 'class' => ''
1311 , 'css' => ''
1312 , 'type' => 'checkbox'
1313 , 'description' => ''
1314 , 'attr' => array()
1315 , 'group' => 'general'
1316 , 'tr_class' => ''
1317 , 'only_field' => false
1318 , 'is_new_line' => true
1319 , 'description_tag' => 'span'
1320 , 'value' => 'On'
1321 )
1322 , true
1323 );
1324 if ( $field_options['required'] )
1325 WPBC_Settings_API::field_checkbox_row_static( $field_name . '_required'
1326 , array(
1327 'type' => 'checkbox'
1328 , 'title' => __('Required', 'booking')
1329 , 'label' => __('Set field as required', 'booking')
1330 , 'disabled' => $field_options[ 'required_attr' ][ 'disabled' ] //false
1331 , 'class' => ''
1332 , 'css' => ''
1333 , 'type' => 'checkbox'
1334 , 'description' => ''
1335 , 'attr' => array()
1336 , 'group' => 'general'
1337 , 'tr_class' => ''
1338 , 'only_field' => false
1339 , 'is_new_line' => true
1340 , 'description_tag' => 'span'
1341 , 'value' => $field_options[ 'required_attr' ][ 'value' ] //'Off'
1342 )
1343 , true
1344 );
1345 if ( $field_options['label'] )
1346 WPBC_Settings_API::field_text_row_static( $field_name . '_label'
1347 , array(
1348 'type' => 'text'
1349 , 'title' => __('Label', 'booking')
1350 , 'disabled' => false
1351 , 'class' => ''
1352 , 'css' => ''
1353 , 'placeholder' => $field_options[ 'label_attr' ][ 'placeholder' ] //'First Name'
1354 , 'description' => ''//__('Enter field label', 'booking')
1355 , 'group' => 'general'
1356 , 'tr_class' => ''
1357 , 'only_field' => false
1358 , 'description_tag' => 'p'
1359 , 'value' => $field_options[ 'label_attr' ][ 'value' ] //''
1360 , 'attr' => array(
1361 'oninput' => "javascript:this.onchange();"
1362 , 'onpaste' => "javascript:this.onchange();"
1363 , 'onkeypress'=> "javascript:this.onchange();"
1364 , 'onchange' => "javascript:if ( ! jQuery('#".$field_name . '_name'."').is(':disabled') ) { jQuery('#".$field_name . '_name'."').val(jQuery(this).val() );} wpbc_check_typed_name('".$field_name."');"
1365 )
1366 )
1367 , true
1368 );
1369 if ( $field_options['name'] )
1370 WPBC_Settings_API::field_text_row_static( $field_name . '_name'
1371 , array(
1372 'type' => 'text'
1373 , 'title' => __('Name', 'booking') . ' *'
1374 , 'disabled' => $field_options[ 'name_attr' ][ 'disabled' ] //false
1375 , 'class' => ''
1376 , 'css' => ''
1377 , 'placeholder' => $field_options[ 'name_attr' ][ 'placeholder' ] //'first_name'
1378 /* translators: 1: ... */
1379 , 'description' => sprintf( __( 'Type only %1$sunique field name%2$s, that is not using in form', 'booking' ), '<strong>', '</strong>' )
1380 , 'group' => 'general'
1381 , 'tr_class' => ''
1382 , 'only_field' => false
1383 , 'description_tag' => 'p'
1384 , 'value' => $field_options[ 'name_attr' ][ 'value' ] //''
1385 , 'attr' => array(
1386 'oninput' => "javascript:this.onchange();"
1387 , 'onpaste' => "javascript:this.onchange();"
1388 , 'onkeypress'=> "javascript:this.onchange();"
1389 , 'onchange' => "javascript:wpbc_check_typed_name('".$field_name."');"
1390
1391 )
1392
1393 )
1394 , true
1395 );
1396 if ( $field_options['value'] )
1397 WPBC_Settings_API::field_textarea_row_static( $field_name . '_value'
1398 , array(
1399
1400 'title' => __('Values', 'booking')
1401 , 'disabled' => false
1402 , 'class' => ''
1403 , 'css' => ''
1404 , 'placeholder' => ''
1405 , 'description' => __('Enter dropdown options. One option per line.', 'booking') //. '<br>'
1406 //. (( 'durationtime_field_generator' !== $field_options['name'] ) ? '' : __( 'The option format is "Title@@Time Duration," where "Title" is usually the service name and "Time Duration" is defined in the format HH:MM (HH = hours from 00 to 23, MM = minutes from 00 to 59).', 'booking' ))
1407 //. (( 'starttime_field_generator' !== $field_options['name'] ) ? '' : __( 'The option format is "Title@@Time," where "Title" is any text (typically the time in AM/PM format) and "Time" is defined in the 24-hour format (HH:MM), where HH = hours (00 to 23) and MM = minutes (00 to 59).', 'booking' ))
1408 , 'group' => 'general'
1409 , 'tr_class' => ''
1410 , 'only_field' => false
1411 , 'description_tag' => 'p'
1412 , 'value' => $field_options[ 'value_attr' ][ 'value' ] // ''
1413 , 'attr' => $field_options[ 'value_attr' ][ 'attr' ] //array( 'placeholder' => "1\n2\n3\n4" ) //Override Placeholder value, because of escaping \n symbols
1414 , 'rows' => $field_options[ 'value_attr' ][ 'rows' ] //2
1415 , 'cols' => $field_options[ 'value_attr' ][ 'cols' ] //37
1416 , 'show_in_2_cols' => false
1417 , 'attr' => array(
1418 'oninput' => "javascript:this.onchange();"
1419 , 'onpaste' => "javascript:this.onchange();"
1420 , 'onkeypress'=> "javascript:this.onchange();"
1421 , 'onchange' => "javascript:wpbc_check_typed_values('".$field_name."');"
1422 )
1423 )
1424 , true
1425 );
1426 do_action( 'wpbc_settings_form_page_after_values', $field_name, $field_options ); //FixIn: TimeFreeGenerator
1427
1428 ?>
1429 <tr><th colspan="2" style="border-bottom:1px solid #eee;padding:10px 0 0;"></th></tr>
1430
1431 <tr class="wpbc_add_field_row">
1432 <th colspan="2" class="wpdevelop">
1433 <a onclick="javascript:wpbc_add_field ( '<?php echo esc_attr( $field_name ); ?>', '<?php echo esc_attr( $field_options['type'] ); ?>' );"
1434 href="javascript:void(0)"
1435 style=""
1436 class="button button-primary"><i class="menu_icon icon-1x wpbc_icn_add _circle_outline"></i>&nbsp;&nbsp;<?php esc_html_e( 'Add New Field' ,'booking'); ?></a>
1437 &nbsp;&nbsp;
1438 <a onclick="javascript:wpbc_hide_fields_generators();"
1439 href="javascript:void(0)"
1440 style=""
1441 class="button button"><i class="menu_icon icon-1x wpbc_icn_close"></i>&nbsp;&nbsp;<?php esc_html_e( 'Cancel' ,'booking'); ?></a>
1442 </th>
1443 </tr>
1444
1445 <tr class="wpbc_edit_field_row">
1446 <th colspan="2" class="wpdevelop">
1447 <a onclick="javascript:wpbc_finish_edit_form_field ( '<?php echo esc_attr( $field_name ); ?>', '<?php echo esc_attr( $field_options['type'] ); ?>' );"
1448 href="javascript:void(0)"
1449 style=""
1450 class="button button-primary"><i class="menu_icon icon-1x wpbc_icn_draw"></i>&nbsp;&nbsp;<?php esc_html_e( 'Save Changes' ,'booking'); ?></a>
1451 &nbsp;&nbsp;
1452 <a onclick="javascript:wpbc_hide_fields_generators();"
1453 href="javascript:void(0)"
1454 style=""
1455 class="button button"><i class="menu_icon icon-1x wpbc_icn_close"></i>&nbsp;&nbsp;<?php esc_html_e( 'Cancel' ,'booking'); ?></a>
1456 </th>
1457 </tr>
1458
1459 </table><?php
1460 }
1461
1462
1463 // <editor-fold defaultstate="collapsed" desc=" Activate | Deactivate " >
1464
1465 public function activate() {
1466
1467 add_bk_option( 'booking_form', wpbc_simple_form__get_booking_form__as_shortcodes() );
1468 add_bk_option( 'booking_form_show', wpbc_simple_form__get_form_show__as_shortcodes() );
1469 add_bk_option( 'booking_form_visual', wpbc_simple_form__visual__get_default_form() );
1470 }
1471
1472 public function deactivate() {
1473
1474 delete_bk_option( 'booking_form' );
1475 delete_bk_option( 'booking_form_show' );
1476 delete_bk_option( 'booking_form_visual');
1477 }
1478
1479 // </editor-fold>
1480 }
1481
1482 add_action('wpbc_menu_created', array( new WPBC_Page_SettingsFormFieldsFree() , '__construct') ); // Executed after creation of Menu
1483
1484
1485
1486 // =====================================================================================================================
1487 // Load JS files at specific pages only
1488 // =====================================================================================================================
1489
1490 /**
1491 * Load JS files.
1492 *
1493 * @param $hook 'post.php' | 'wp-booking-calendar3_page_wpbc-resources'
1494 *
1495 * @return void
1496 */
1497 function wpbc_register_js__page_form_simple( $hook ) {
1498
1499 if (
1500 ( isset( $_REQUEST['page'] ) ) && ( 'wpbc-settings' === $_REQUEST['page'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
1501 && ( isset( $_REQUEST['tab'] ) ) && ( 'form' === $_REQUEST['tab'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
1502 ) {
1503 // wpbc_load_js__required_for_modals();
1504 // wpbc_load_js__required_for_media_upload();
1505 wp_enqueue_script( 'wpbc_simple_form', wpbc_plugin_url( '/includes/page-form-simple/_src/wpbc_simple_form.js' ), array( 'wpbc_all' ), WP_BK_VERSION_NUM, array( 'in_footer' => WPBC_JS_IN_FOOTER ) );
1506 }
1507 }
1508
1509 add_action( 'admin_enqueue_scripts', 'wpbc_register_js__page_form_simple' );
1510