PluginProbe
Booking Calendar / 10.10
Booking Calendar v10.10
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 10.11.2 10.11.3 All 202 releases
booking / core / admin / page-settings.php

page-settings.php in Booking Calendar 10.10, at core/admin/page-settings.php

673 lines 30.9 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 Content of Settings page
5 * @author wpdevelop
6 *
7 * @web-site https://wpbookingcalendar.com/
8 * @email info@wpbookingcalendar.com
9 *
10 * @modified 2015-11-02
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
15
16 /**
17 * Show Content
18 * Update Content
19 * Define Slug
20 * Define where to show
21 */
22 class WPBC_Page_SettingsGeneral extends WPBC_Page_Structure {
23
24 /**
25 * Link to Settings API obj
26 *
27 * @var bool
28 */
29 private $settings_api = false;
30
31 public function __construct() {
32
33 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { // If this User not "super admin", then do not load this page at all
34 // If tab was not selected or selected default, then redirect it to the "form" tab.
35 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
36 if ( ( isset( $_REQUEST['page'] ) && ( 'wpbc-settings' === $_REQUEST['page'] ) ) && ( ( ! isset( $_REQUEST['tab'] ) ) || ( 'general' === $_REQUEST['tab'] ) ) ) {
37 $_REQUEST['tab'] = 'form';
38 }
39 } else {
40 parent::__construct();
41 }
42 }
43
44 public function in_page() {
45
46 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { // If this User not "super admin", then do not load this page at all.
47 return (string) wp_rand( 100000, 1000000 );
48 }
49
50 return 'wpbc-settings';
51 }
52
53
54 /**
55 * Get Settings API class - define, show, update "Fields".
56 *
57 * @return object Settings API
58 */
59 public function settings_api() {
60
61 if ( false === $this->settings_api ) {
62 $this->settings_api = new WPBC_Settings_API_General();
63 }
64
65 return $this->settings_api;
66 }
67
68
69 public function tabs() {
70
71 $tabs = array();
72
73 $tabs['general'] = array(
74 'title' => __( 'General', 'booking' ), // Title of TAB.
75 'page_title' => __( 'General Settings', 'booking' ), // Title of Page.
76 'hint' => __( 'General Settings', 'booking' ), // Hint.
77 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
78 'position' => '', // 'left' / 'right' / ''.
79 'css_classes' => '', // CSS.
80 'icon' => '', // Icon - link to the real PNG img.
81 'font_icon' => 'wpbc_icn_tune', // CSS definition of forn Icon.
82 'default' => true // Is this tab activated by default or not: true / false.
83 );
84
85 $subtabs = array();
86
87 $tabs['general']['subtabs'] = $subtabs;
88
89 return $tabs;
90 }
91
92
93 public function content() {
94
95 // Checking.
96
97 do_action( 'wpbc_hook_settings_page_header', 'general_settings' ); // Define Notices Section and show some static messages, if needed.
98
99 if ( ! wpbc_is_mu_user_can_be_here( 'activated_user' ) ) {
100 return false;
101 } // Check if MU user activated, otherwise show Warning message.
102
103 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) {
104 return false;
105 } // User is not Super admin, so exit. Basically its was already checked at the bottom of the PHP file, just in case.
106
107 $is_can = apply_bk_filter( 'recheck_version', true );
108 if ( ! $is_can ) {
109 ?>
110 <script type="text/javascript"> jQuery(document).ready(function () {
111 jQuery('.wpdvlp-sub-tabs').remove();
112 });
113 </script>
114 <?php
115 return;
116 }
117
118
119 // Init Settings API & Get Data from DB.
120 $this->settings_api(); // Define all fields and get values from DB.
121
122 // Submit .
123
124 $submit_form_name = 'wpbc_general_settings_form'; // Define form name.
125
126 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
127 if ( isset( $_POST[ 'is_form_sbmitted_' . $submit_form_name ] ) ) {
128
129 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }.
130 $nonce_gen_time = check_admin_referer( 'wpbc_settings_page_' . $submit_form_name ); // Its stop show anything on submiting, if its not refear to the original page.
131
132 // Save Changes .
133 $this->update();
134 }
135 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
136 if ( ! empty( $_GET['scroll_to_section'] ) ) {
137 ?>
138 <script type="text/javascript">
139 jQuery(document).ready(function () {
140 jQuery('#<?php echo esc_js( sanitize_text_field( wp_unslash( $_GET['scroll_to_section'] ) ) ); ?> a').trigger('click');
141 });
142 </script>
143 <?php
144 }
145
146 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
147 if ( ( isset( $_GET['wpbc_setup_wizard'] ) ) && ( 'reset' === $_GET['wpbc_setup_wizard'] ) ) {
148
149 wpbc_setup_wizard_page__force_in_get();
150
151 ?>
152 <div class="wpdvlp-sub-tabs wpbc_redirection_message" style="margin: 20px 0;padding: 1em;font-size: 14px;">
153 <a href="<?php echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>">Redirect</a> after <span class="wpbc_countdown">1</span> second...</div>
154 <?php
155
156 wpbc_redirect( wpbc_get_setup_wizard_page_url() );
157 }
158
159 // JavaScript: Tooltips, Popover, Datepick (js & css) .
160 echo '<span class="wpdevelop">';
161 wpbc_js_for_bookings_page();
162 echo '</span>';
163
164 wpbc_ui_settings__top_path();
165
166 // Content .
167 ?>
168 <div class="clear"></div>
169 <div class="wpbc_settings_flex_container">
170
171 <div class="wpbc_settings_flex_container_left">
172
173 <div class="wpbc_settings_navigation_column">
174
175 <div id="wpbc_general_settings_dashboard_tab" class="wpbc_settings_navigation_item wpbc_settings_navigation_item_active">
176 <?php
177 $title = esc_attr__( 'Dashboard', 'booking' );
178 ?>
179 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_js( $title ); ?>' );"
180 href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
181 </div>
182 <div id="wpbc_general_settings_calendar_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
183 <?php
184 $title = esc_attr__( 'Calendar', 'booking' );
185 ?>
186 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_calendar_tab a' ,'#wpbc_general_settings_calendar_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
187 </div>
188 <div id="wpbc_general_settings_days_tooltips_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
189 <?php
190 $title = esc_attr__( 'Tooltips in days', 'booking' );
191 ?>
192 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_days_tooltips_tab a' ,'#wpbc_general_settings_days_tooltips_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
193 </div>
194 <div id="wpbc_general_settings_availability_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
195 <?php
196 $title = esc_attr__( 'Availability', 'booking' );
197 ?>
198 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_availability_tab a' ,'#wpbc_general_settings_availability_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
199 </div>
200 <div id="wpbc_general_settings_capacity_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
201 <?php
202 $title = esc_attr__( 'Capacity', 'booking' );
203 ?>
204 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_capacity_tab a' ,'#wpbc_general_settings_capacity_metabox,#wpbc_general_settings_capacity_upgrade_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
205 </div>
206 <div id="wpbc_general_settings_form_tab" class="wpbc_settings_navigation_item">
207 <?php
208 $title = esc_attr__( 'Form Options', 'booking' );
209 ?>
210 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_form_tab a' ,'#wpbc_general_settings_form_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
211 </div>
212 <div id="wpbc_general_settings_time_slots_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
213 <?php
214 $title = esc_attr__( 'Time Slots', 'booking' );
215 ?>
216 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_time_slots_tab a' ,'#wpbc_general_settings_time_slots_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
217 </div>
218 <div id="wpbc_general_settings_booking_confirmation_tab" class="wpbc_settings_navigation_item">
219 <?php
220 $title = esc_attr__( 'Booking Confirmation', 'booking' );
221 ?>
222 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_confirmation_tab a' ,'#wpbc_general_settings_booking_confirmation_metabox,#wpbc_general_settings_booking_confirmation_left_metabox,#wpbc_general_settings_booking_confirmation_right_metabox,#wpbc_general_settings_booking_confirmation_help_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
223 </div>
224
225 <div id="wpbc_general_settings_booking_timeline_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
226 <?php
227 $title = esc_attr__( 'Timeline (front-end)', 'booking' );
228 ?>
229 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_timeline_tab a' ,'#wpbc_general_settings_booking_timeline_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
230 </div>
231 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
232 <div id="wpbc_general_settings_bookings_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
233 <?php
234 $title = esc_attr__( 'Manage Bookings', 'booking' );
235 ?>
236 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_bookings_options_tab a' ,'#wpbc_general_settings_bookings_options_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
237 </div>
238 <?php } ?>
239
240 <?php if ( class_exists('wpdev_bk_biz_s') ) { ?>
241 <div id="wpbc_general_settings_auto_cancelation_approval_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
242 <?php
243 $title = esc_attr__( 'Auto Cancellation / Auto Approval', 'booking' );
244 ?>
245 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_auto_cancelation_approval_tab a' ,'#wpbc_general_settings_auto_cancelation_approval_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
246 </div>
247 <?php } ?>
248
249
250 <?php if ( class_exists('wpdev_bk_multiuser') ) { ?>
251 <div id="wpbc_general_settings_multiuser_tab" class="wpbc_settings_navigation_item">
252 <?php
253 $title = esc_attr__( 'Multiuser options', 'booking' );
254 ?>
255 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_multiuser_tab a' ,'#wpbc_general_settings_multiuser_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
256 </div>
257 <?php } ?>
258
259 <div id="wpbc_general_settings_booking_listing_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
260 <?php
261 $title = esc_attr__( 'Admin Panel', 'booking' );
262 ?>
263 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_listing_tab a' ,'#wpbc_general_settings_booking_listing_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
264 </div>
265 <div id="wpbc_general_settings_booking_calendar_overview_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
266 <?php
267 $title = esc_attr__( 'Timeline View', 'booking' );
268 ?>
269 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_calendar_overview_tab a' ,'#wpbc_general_settings_booking_calendar_overview_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
270 </div>
271 <div id="wpbc_general_settings_datestimes_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
272 <?php
273 $title = esc_attr__( 'Date / Time Formats', 'booking' );
274 ?>
275 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_datestimes_tab a' ,'#wpbc_general_settings_datestimes_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
276 </div>
277 <div id="wpbc_general_settings_permissions_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
278 <?php
279 $title = esc_attr__( 'Plugin Menu / Permissions', 'booking' );
280 ?>
281 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_permissions_tab a' ,'#wpbc_general_settings_permissions_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
282 </div>
283 <div id="wpbc_general_settings_translations_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
284 <?php
285 $title = esc_attr__( 'Translations', 'booking' );
286 ?>
287 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_translations_tab a' ,'#wpbc_general_settings_translations_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
288 </div>
289 <div id="wpbc_general_settings_advanced_tab" class="wpbc_settings_navigation_item">
290 <?php
291 $title = esc_attr__( 'Advanced', 'booking' );
292 ?>
293 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_advanced_tab a' ,'#wpbc_general_settings_advanced_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
294 </div>
295 <div id="wpbc_general_settings_uninstall_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
296 <?php
297 $title = esc_attr__( 'Uninstall / deactivation', 'booking' );
298 ?>
299 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_uninstall_tab a' ,'#wpbc_general_settings_uninstall_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
300 </div>
301 <div id="wpbc_general_settings_information_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
302 <?php
303 $title = esc_attr__( 'Info / News', 'booking' );
304 ?>
305 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_information_tab a' ,'#wpbc_general_settings_information_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
306 </div>
307 <?php if ( ( class_exists('wpdev_bk_personal') ) && ( ! wpbc_is_this_demo() ) ) { ?>
308 <div id="wpbc_general_settings_help_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
309 <?php
310 $title = esc_attr__( 'Tools', 'booking' );
311 ?>
312 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_help_tab a' ,'#wpbc_general_settings_help_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
313 </div>
314 <?php } ?>
315
316 <div id="wpbc_general_settings_all_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
317 <?php
318 $title = esc_attr__( 'Show All Settings', 'booking' );
319 ?>
320 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_all_tab a' ,'.postbox', '<?php echo esc_js( $title ); ?>' );"
321 href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
322 </div>
323
324 </div>
325
326 </div>
327 <div class="wpbc_settings_flex_container_right">
328
329 <span class="metabox-holder">
330 <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post">
331 <?php
332 // N o n c e field, and key for checking S u b m i t.
333 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
334 ?>
335 <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"/>
336 <input type="hidden" name="form_visible_section" id="form_visible_section" value=""/>
337
338 <?php
339 if ( wpbc_is_show_general_setting_options() ) {
340 // FixIn: 8.9.4.11.
341 ?>
342
343 <div class="wpbc_settings_row wpbc_settings_row_full_width" >
344
345 <div id="wpbc_general_settings_dashboard_metabox" class="postbox"
346 style="background: transparent;border: 0;box-shadow: none;"><?php //wpbc_open_meta_box_section( 'wpbc_general_settings_dashboard', __('Dashboard'), array( 'is_section_visible_after_load' => true, 'is_show_minimize' => false ) ); ?>
347 <?php
348
349 wpbc_ui_settings__panel__statistic();
350
351 wpbc_ui_settings__panel__all_settings_panels();
352
353 wpbc_ui_settings__panel__plugin_version();
354
355 ?></div><?php //wpbc_close_meta_box_section(); ?>
356
357
358 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_calendar', __('Calendar', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
359
360 <?php $this->settings_api()->show( 'calendar' ); ?>
361
362 <?php wpbc_close_meta_box_section(); ?>
363
364
365 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_days_tooltips', __('Calendar Dates Tooltips', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
366
367 <?php $this->settings_api()->show( 'days_tooltips' ); ?>
368
369 <?php wpbc_close_meta_box_section(); ?>
370
371
372
373 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_time_slots', __('Time Slots', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
374
375 <?php $this->settings_api()->show( 'time_slots' ); ?>
376
377 <?php wpbc_close_meta_box_section(); ?>
378
379
380 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_availability', __('Availability', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
381
382 <?php $this->settings_api()->show( 'availability' ); ?>
383
384 <?php wpbc_close_meta_box_section(); ?>
385
386
387 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_form', __('Form Options', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
388
389 <?php $this->settings_api()->show( 'form' ); ?>
390
391 <?php wpbc_close_meta_box_section(); ?>
392
393
394 <?php
395 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation',
396 __( 'Booking Confirmation', 'booking' ),
397 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
398 $this->settings_api()->show( 'booking_confirmation' );
399 wpbc_close_meta_box_section();
400 ?>
401 <div class="wpbc_settings_row wpbc_settings_row_left">
402 <?php
403 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_left',
404 __( 'Section', 'booking' ) . ': ' . __( 'Personal Information', 'booking' ),
405 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
406 $this->settings_api()->show( 'booking_confirmation_left' );
407 wpbc_close_meta_box_section();
408
409 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_right',
410 __( 'Section', 'booking' ) . ': ' . __( 'Booking details', 'booking' ),
411 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
412 $this->settings_api()->show( 'booking_confirmation_right' );
413 wpbc_close_meta_box_section();
414 ?>
415 </div>
416 <div class="wpbc_settings_row wpbc_settings_row_right">
417 <?php
418 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_help',
419 __( 'Shortcodes', 'booking' ),
420 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
421 $this->settings_api()->show( 'booking_confirmation_help' );
422 wpbc_close_meta_box_section();
423 ?>
424 </div>
425 <div class="clear"></div>
426
427 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
428 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_bookings_options', __('Bookings Options', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
429
430 <?php $this->settings_api()->show( 'bookings_options' ); ?>
431
432 <?php wpbc_close_meta_box_section(); ?>
433 <?php } ?>
434
435
436 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_booking_listing', __('Booking Admin Panel', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
437
438 <?php $this->settings_api()->show( 'booking_listing' ); ?>
439
440 <?php wpbc_close_meta_box_section(); ?>
441
442
443 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_booking_calendar_overview', __('Calendar Overview (admin panel)', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
444
445 <?php // FixIn: 8.5.2.20.
446 $this->settings_api()->show( 'booking_calendar_overview' );
447 ?>
448
449 <?php wpbc_close_meta_box_section(); ?>
450
451
452 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_booking_timeline', __('Timeline (front-end)', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
453
454 <?php
455 $this->settings_api()->show( 'booking_timeline' );
456 ?>
457
458 <?php wpbc_close_meta_box_section(); ?>
459
460
461 <?php if ( class_exists('wpdev_bk_biz_s') ) { ?>
462
463
464 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_auto_cancelation_approval', __('Auto cancellation / auto approval of bookings', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
465
466 <?php $this->settings_api()->show( 'auto_cancelation_approval' ); ?>
467
468 <?php wpbc_close_meta_box_section(); ?>
469
470 <?php } ?>
471
472
473
474 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_capacity', __('Capacity', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
475
476 <?php $this->settings_api()->show( 'capacity' ); ?>
477
478 <?php wpbc_close_meta_box_section(); ?>
479
480
481 <?php
482 if ( ! class_exists( 'wpdev_bk_personal' ) ) {
483
484 $wpbc_metabox_id = 'wpbc_general_settings_capacity_upgrade';
485
486 ob_start();
487 $is_panel_visible = wpbc_is_dismissed( $wpbc_metabox_id . '_metabox', array(
488 'title' => '<i class="menu_icon icon-1x wpbc_icn_close"></i> ',
489 'hint' => __( 'Dismiss', 'booking' ),
490 'class' => 'wpbc_panel_get_started_dismiss',
491 'css' => 'background: #fff;border-radius: 7px;'
492 ));
493 ?>
494 <script type="text/javascript"> jQuery('#<?php echo esc_js( $wpbc_metabox_id ); ?>_metabox').hide(); </script>
495 <?php
496 $dismiss_button_content = ob_get_clean();
497
498 if ( $is_panel_visible ) {
499
500 wpbc_open_meta_box_section( $wpbc_metabox_id,
501 __('Booking Quantity Control - Set limits for the number of bookings per day or time slot.', 'booking'),
502 array( 'is_section_visible_after_load' => false,
503 'is_show_minimize' => false,
504 'dismiss_button' => $dismiss_button_content
505 ) );
506
507 $this->settings_api()->show( 'capacity_upgrade' );
508
509 wpbc_close_meta_box_section();
510 }
511 }
512 ?>
513
514
515 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_advanced', __('Advanced', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
516
517 <?php $this->settings_api()->show( 'advanced' ); ?>
518
519 <?php wpbc_close_meta_box_section(); ?>
520
521
522 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_information', __('Information', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
523
524 <?php $this->settings_api()->show( 'information' ); ?>
525
526 <?php wpbc_close_meta_box_section(); ?>
527
528
529
530 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_datestimes', __('Date : Time', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
531
532 <?php $this->settings_api()->show( 'date_time' ); ?>
533
534 <?php wpbc_close_meta_box_section(); ?>
535
536
537
538 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_permissions', __('Plugin Menu', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
539
540 <?php $this->settings_api()->show( 'permissions' ); ?>
541
542 <?php wpbc_close_meta_box_section(); ?>
543
544
545 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_uninstall', __('Uninstall / deactivation', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
546
547 <?php $this->settings_api()->show( 'uninstall' ); ?>
548
549 <?php wpbc_close_meta_box_section(); ?>
550
551 <?php if ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! wpbc_is_this_demo() ) ) { ?>
552 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_help', __( 'Tools', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
553
554 <?php $this->settings_api()->show( 'help' ); ?>
555
556 <?php wpbc_close_meta_box_section(); ?>
557 <?php } ?>
558
559 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_translations', __( 'Translations', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
560
561 <?php $this->settings_api()->show( 'translations' ); ?>
562
563 <?php wpbc_translation_buttons_settings_section(); ?>
564
565 <?php wpbc_close_meta_box_section(); ?>
566
567 <?php if ( class_exists( 'wpdev_bk_multiuser' ) ) { // FixIn: 9.2.3.8. ?>
568
569 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_multiuser', __( 'Multiuser options', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
570
571 <?php $this->settings_api()->show( 'multiuser' ); ?>
572
573 <?php wpbc_close_meta_box_section(); ?>
574
575 <?php } ?>
576
577 </div>
578 <div class="clear"></div>
579 <input type="submit" value="<?php esc_attr_e( 'Save Changes', 'booking' ); ?>" class="button button-primary wpbc_submit_button"/>
580 <?php
581 if ( 'translations_updated_from_wpbc_and_wp' !== get_bk_option( 'booking_translation_update_status' ) ) {
582
583 $current_locale = wpbc_get_maybe_reloaded_booking_locale();
584
585 if ( ! in_array( $current_locale, array( 'en_US', 'en_CA', 'en_GB', 'en_AU' ) ) ) {
586
587 echo '<a class="button button" href="'
588 . esc_url( wpbc_get_settings_url() . '&system_info=show&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) . '&update_translations=1#wpbc_general_settings_system_info_metabox' )
589 . '">'
590 . esc_html__( 'Update Translations', 'booking' )
591 . '</a>';
592 }
593 }
594
595 if ( ! wpbc_is_this_demo() ) {
596
597 echo '<a style="margin:0 2em;" class="button button" href="'
598 . esc_url( wpbc_get_settings_url() . '&system_info=show&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) . '&restore_dismissed=On#wpbc_general_settings_restore_dismissed_metabox' )
599 . '">'
600 . esc_html__( 'Restore all dismissed windows', 'booking' )
601 . '</a>';
602 }
603 ?>
604
605 <?php } ?>
606 </form>
607 </span>
608
609 </div>
610 </div>
611
612
613 <?php
614
615 do_action( 'wpbc_hook_settings_page_footer', 'general_settings' );
616 }
617
618
619 public function update() {
620
621 $validated_fields = $this->settings_api()->validate_post(); // Get Validated Settings fields in $_POST request.
622
623 $validated_fields = apply_filters( 'wpbc_settings_validate_fields_before_saving', $validated_fields ); // Hook for validated fields.
624
625 /**
626 * Skip saving specific option, for example in Demo mode.
627 * // unset( $validated_fields['booking_start_day_weeek'] );
628 */
629
630 // FixIn: 9.8.6.1.
631 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
632 if ( ! empty( $_POST['form_visible_section'] ) ) {
633 ?>
634 <script type="text/javascript">
635 jQuery(document).ready(function () {
636 jQuery('<?php
637 // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
638 echo esc_js( $_POST['form_visible_section'] );
639 ?> a').trigger('click');
640 });
641 </script>
642 <?php
643 }
644
645 $this->settings_api()->save_to_db( $validated_fields ); // Save fields to DB.
646
647 wpbc_show_changes_saved_message();
648
649 /**
650 * // O L D W A Y: Saving Fields Data
651 * // update_bk_option( 'booking_is_delete_if_deactive'
652 * // , WPBC_Settings_API::validate_checkbox_post('booking_is_delete_if_deactive') );
653 * // ( (isset( $_POST['booking_is_delete_if_deactive'] ))?'On':'Off') );
654 */
655 }
656 }
657
658
659 /**
660 *
661
662 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { // If this User not "super admin", then do not load this page at all
663
664 if ( ( ! isset( $ _GET['tab'] ) ) || ( $_GET['tab'] == 'general' ) ) { // If tab was not selected or selected default, then redirect it to the "form" tab.
665 $_GET['tab'] = 'form';
666 }
667 } else {
668 add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu
669 }
670 */
671
672 add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu
673