PluginProbe
Booking Calendar / 10.11.3
Booking Calendar v10.11.3
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 10.11 All 204 releases
booking / includes / page-form-simple / page-form-simple.php

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

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