PluginProbe
Booking Calendar / 11.0
Booking Calendar v11.0
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 10.11.2 All 203 releases
booking / core / admin / page-settings.php

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

1,119 lines 60.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 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 // Init vars.
72 $separator_i = 0;
73 $tabs = array();
74 $subtabs = array();
75 $subtab_default = array(
76 'type' => 'subtab', // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'.
77 'title' => '', // Example: __( 'Dashboard' // Title of TAB.
78 'page_title' => '', // __( 'Search Availability' // Title of Page.
79 'hint' => '', // __( 'Configure the layout and functionality of both the search form and search results.' // Hint.
80 'link' => '', // wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_dashboard_tab', // Link.
81 'css_classes' => '', // cls CSS .
82 'font_icon' => 'wpbc_icn_dashboard',
83 'font_icon_right' => 'wpbc-bi-question-circle', // 'wpbc-bi-question-circle' .
84 'default' => false, // Is this sub tab activated by default or not: true || false.
85 );
86
87 // =============================================================================================================
88 // == D A S H B O A R D ==
89 // =============================================================================================================
90 $tabs['general'] = array(
91 'is_show_top_path' => true, // true | false. By default value is: false.
92 'is_show_top_navigation' => false, // true | false. By default value is: false.
93 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
94 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
95 // translators: 1: Booking Calendar.
96 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
97 'title' => __( 'Dashboard', 'booking' ), // Left Vertical Menu - Title.
98 // translators: 1: Booking Calendar.
99 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
100 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
101 'default' => true, // Is this tab activated by default or not: true / false.
102 'font_icon' => 'wpbc-bi-speedometer2',
103 // 'font_icon_right' => 'wpbc-bi-question-circle',
104 'css_classes' => 'do_expand__' . 'wpbc_general_settings_dashboard_metabox' . '_link',
105 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . 'wpbc_general_settings_dashboard_metabox' . "' );",
106 'folder_style' => 'order:10;',
107 );
108 // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:10;' ) );
109
110
111 // =============================================================================================================
112 // == C A L E N D A R + B O O K I N G _ P R O C E S S ==
113 // =============================================================================================================
114 $tabs['calendar_booking_process'] = array(
115 'page_title' => __( 'Calendar and Form Settings', 'booking' ), // Header - Title. If false, than hidden.
116 // translators: 1: Booking Calendar.
117 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
118 'title' => __( 'Calendar', 'booking' ), // Left Vertical Menu - Title. + Booking Process.
119 // translators: 1: Booking Calendar.
120 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
121 'font_icon' => 'wpbc-bi-calendar2-range', // Left Vertical Menu - Icon.
122 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
123 'css_classes' => '', // CSS.
124 'default' => false, // Is this tab activated by default or not: true / false.
125 'folder_style' => 'order:11;',
126 );
127
128 $section_id = 'wpbc_general_settings_calendar_metabox';
129 $subtabs['calendar'] = array_merge(
130 $subtab_default,
131 array(
132 'title' => __( 'Calendar Settings', 'booking' ),
133 'page_title' => __( 'General Settings', 'booking' ),
134 'hint' => __( 'Customize various calendar settings, specify how many months can be scrolled, and defining the legend.', 'booking' ),
135 'font_icon' => 'wpbc-bi-calendar2-range',
136 'font_icon_right' => 'wpbc-bi-question-circle',
137 'css_classes' => 'do_expand__' . $section_id . '_link', // sub_bold', .
138 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
139 'default' => false,
140 )
141 );
142
143 $section_id = 'wpbc_general_settings_calendar_metabox' . '#do_other_actions__' . 'blink_day_selections';
144 $subtabs['days_selection'] = array_merge(
145 $subtab_default,
146 array(
147 'title' => __( 'Days Selection', 'booking' ),
148 'page_title' => __( 'General Settings', 'booking' ),
149 'hint' => __( 'Choose how users can select days: single day, multiple days, or a date range with minimum and maximum limits.', 'booking' ),
150 'font_icon' => 'wpbc-bi-calendar3-week',
151 'font_icon_right' => 'wpbc-bi-question-circle',
152 'css_classes' => 'do_expand__' . $section_id . '_link', // sub_bold', .
153 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
154 'default' => false,
155 )
156 );
157
158
159 if ( class_exists('wpdev_bk_biz_s') ) {
160 $section_id = 'wpbc_general_settings_calendar_metabox' . '#do_other_actions__' . 'blink_change_over_days';
161 $subtabs['change_over_days'] = array_merge(
162 $subtab_default,
163 array(
164 'title' => __( 'Changeover Days', 'booking' ),
165 'page_title' => __( 'General Settings', 'booking' ),
166 'hint' => __( 'Set up check-in and check-out days for multi-day bookings, with visual indicators like diagonal or vertical lines. Ideal for bookings that require split days.', 'booking' ),
167 'font_icon' => 'wpbc_icn_flip',
168 'font_icon_right' => 'wpbc-bi-question-circle',
169 'css_classes' => 'do_expand__' . $section_id . '_link', // sub_bold', .
170 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
171 'default' => false,
172 )
173 );
174 }
175
176 $section_id = 'wpbc_general_settings_days_tooltips_metabox';
177 $subtabs['days_tooltips'] = array_merge(
178 $subtab_default,
179 array(
180 'title' => __( 'Tooltips in days', 'booking' ),
181 'page_title' => __( 'General Settings', 'booking' ),
182 'hint' => __( 'Configure tooltips to display information like booked times, costs, details, and availability when hovering over calendar days.', 'booking' ),
183 'font_icon' => 'wpbc-bi-chat-square-dots',
184 'font_icon_right' => 'wpbc-bi-question-circle',
185 'css_classes' => 'do_expand__' . $section_id . '_link',
186 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
187 'default' => false,
188 )
189 );
190
191 $section_id = 'wpbc_general_settings_availability_metabox';
192 $subtabs['availability'] = array_merge(
193 $subtab_default,
194 array(
195 'title' => __( 'General Availability', 'booking' ),
196 'page_title' => __( 'General Settings', 'booking' ),
197 'hint' => __( 'Define unavailable weekdays, add booking buffers, and customize unavailable day options.', 'booking' ),
198 'font_icon' => 'wpbc-bi-calendar2-day',
199 'font_icon_right' => 'wpbc-bi-question-circle',
200 'css_classes' => 'do_expand__' . $section_id . '_link',
201 'link' => function_exists( 'wpbc_get_general_availability_url' ) ? wpbc_get_general_availability_url() : admin_url( 'admin.php?page=wpbc-availability&tab=general_availability' ),
202 'onclick' => '',
203 'default' => false,
204 )
205 );
206
207 $section_id = 'wpbc_general_settings_capacity_metabox#wpbc_general_settings_capacity_upgrade_metabox';
208 $subtabs['capacity'] = array_merge(
209 $subtab_default,
210 array(
211 'title' => __( 'Booking Capacity', 'booking' ),
212 'page_title' => __( 'General Settings', 'booking' ),
213 'hint' => __( 'Manage the ability to accept multiple bookings for the same date or time slot.', 'booking' ),
214 'font_icon' => 'wpbc_icn_filter_none',
215 'font_icon_right' => 'wpbc-bi-question-circle',
216 'css_classes' => 'do_expand__' . 'wpbc_general_settings_capacity_metabox' . '_link',
217 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
218 'default' => false,
219 )
220 );
221
222
223 $tabs['calendar_booking_process']['subtabs'] = $subtabs;
224
225
226 // =============================================================================================================
227 // == C O N F I R M A T I ON ==
228 // =============================================================================================================
229 $tabs['booking_confirmation'] = array(
230 'is_show_top_path' => false, // true | false. By default value is: false.
231 'is_show_top_navigation' => false, // true | false. By default value is: false.
232 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
233 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
234 // translators: 1: Booking Calendar.
235 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
236 'title' => __( 'Booking Confirmation', 'booking' ), // Left Vertical Menu - Title.
237 'hint' => __( 'Customize how the booking summary is displayed after a booking is created', 'booking' ),
238 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
239 'default' => false, // Is this tab activated by default or not: true / false.
240 'font_icon' => 'wpbc-bi-card-checklist',
241 'font_icon_right' => 'wpbc-bi-question-circle',
242 'css_classes' => 'do_expand__' . 'wpbc_general_settings_booking_confirmation_metabox' . '_link',
243 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" .
244 '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' .
245 "' );",
246 'folder_style' => 'order:20;',
247 );
248
249 // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:20;' ) );
250
251 // =============================================================================================================
252 // == Manage Bookings ==
253 // =============================================================================================================
254 $tabs['manage_bookings'] = array(
255 'is_show_top_path' => false, // true | false. By default value is: false.
256 'is_show_top_navigation' => false, // true | false. By default value is: false.
257 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
258 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
259 // translators: 1: Booking Calendar.
260 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
261 'title' => __( 'Manage Bookings', 'booking' ), // Left Vertical Menu - Title.
262 // translators: 1: Booking Calendar.
263 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
264 'font_icon' => 'wpbc_icn_app_registration', // Left Vertical Menu - Icon.
265 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
266 'css_classes' => '', // CSS.
267 'icon' => '', // Icon - link to the real PNG img.
268 'default' => false, // Is this tab activated by default or not: true / false.
269 'folder_style' => 'order:1000',
270 );
271
272 $subtabs = array();
273
274 $section_id = 'wpbc_general_settings_booking_timeline_metabox';
275 $subtabs['booking_timeline'] = array_merge(
276 $subtab_default,
277 array(
278 'title' => __( 'Timeline (front-end)', 'booking' ),
279 'page_title' => __( 'General Settings', 'booking' ),
280 'hint' => __( 'Customize timeline options, including the display of booking details.', 'booking' ),
281 'font_icon' => 'wpbc_icn_align_vertical_bottom wpbc_icn_rotate_90',
282 'font_icon_right' => 'wpbc-bi-question-circle',
283 'css_classes' => 'do_expand__' . $section_id . '_link ',
284 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
285 'default' => false,
286 )
287 );
288
289 if ( class_exists('wpdev_bk_personal') ) {
290 $section_id = 'wpbc_general_settings_bookings_options_metabox';
291 $subtabs['bookings_options'] = array_merge(
292 $subtab_default,
293 array(
294 'title' => __( 'Manage Bookings', 'booking' ),
295 'page_title' => __( 'General Settings', 'booking' ),
296 'hint' => __( 'Allow customers to edit or cancel their own bookings.', 'booking' ),
297 'font_icon' => 'wpbc_icn_app_registration mode_edit_outline edit_calendar',
298 'font_icon_right' => 'wpbc-bi-question-circle',
299 'css_classes' => 'do_expand__' . $section_id . '_link ',
300 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
301 'default' => false,
302 )
303 );
304 }
305
306
307 if ( class_exists('wpdev_bk_biz_s') ) {
308 $section_id = 'wpbc_general_settings_auto_cancelation_approval_metabox';
309 $subtabs['auto_cancelation_approval'] = array_merge(
310 $subtab_default,
311 array(
312 'title' => __( 'Auto Cancellation / Auto Approval', 'booking' ),
313 'page_title' => __( 'General Settings', 'booking' ),
314 'hint' => __( 'Enable automatic approval or cancellation of bookings.', 'booking' ),
315 'font_icon' => 'wpbc_icn_published_with_changes',
316 'font_icon_right' => 'wpbc-bi-question-circle',
317 'css_classes' => 'do_expand__' . $section_id . '_link',
318 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
319 'default' => false,
320 )
321 );
322 }
323
324 $tabs['manage_bookings']['subtabs'] = $subtabs;
325
326
327 // =============================================================================================================
328 // == Admin Panel ==
329 // =============================================================================================================
330 $tabs['admin_panel'] = array(
331 'is_show_top_path' => false, // true | false. By default value is: false.
332 'is_show_top_navigation' => false, // true | false. By default value is: false.
333 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
334 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
335 'page_description' => __( 'Configure various options and settings in the admin panel.', 'booking' ), // Header - Title Description. If false, than hidden.
336 'title' => __( 'Admin Panel', 'booking' ), // Left Vertical Menu - Title.
337 // translators: 1: Booking Calendar.
338 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
339 'font_icon' => 'wpbc_icn_widgets', // Left Vertical Menu - Icon.
340 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
341 'css_classes' => '', // CSS.
342 'icon' => '', // Icon - link to the real PNG img.
343 'default' => false, // Is this tab activated by default or not: true / false.
344 'folder_style' => 'order:1000',
345 );
346
347 $subtabs = array();
348
349 $section_id = 'wpbc_general_settings_booking_listing_metabox';
350 $subtabs['booking_listing'] = array_merge(
351 $subtab_default,
352 array(
353 'title' => __( 'Booking Admin Panel', 'booking' ),
354 'page_title' => __( 'General Settings', 'booking' ),
355 'hint' => __( 'Configure various options and settings in the admin panel.', 'booking' ),
356 'font_icon' => 'wpbc-bi-list',
357 'font_icon_right' => 'wpbc-bi-question-circle',
358 'css_classes' => 'do_expand__' . $section_id . '_link',
359 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
360 'default' => false,
361 )
362 );
363
364 $section_id = 'wpbc_general_settings_booking_calendar_overview_metabox';
365 $subtabs['booking_calendar_overview'] = array_merge(
366 $subtab_default,
367 array(
368 'title' => __( 'Timeline View (Back-End)', 'booking' ),
369 'page_title' => __( 'General Settings', 'booking' ),
370 'hint' => __( 'Customize timeline options in the admin panel, including displaying booking details.', 'booking' ),
371 'font_icon' => 'wpbc-bi-bar-chart-steps _icn_timeline 0wpbc_icn_rotate_45 0wpbc_icn_align_vertical_bottom',
372 'font_icon_right' => 'wpbc-bi-question-circle',
373 'css_classes' => 'do_expand__' . $section_id . '_link',
374 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
375 'default' => false,
376 )
377 );
378
379 $section_id = 'wpbc_general_settings_datestimes_metabox';
380 $subtabs['datestimes'] = array_merge(
381 $subtab_default,
382 array(
383 'title' => __( 'Date and Time Formats', 'booking' ),
384 'page_title' => __( 'General Settings', 'booking' ),
385 'hint' => __( 'Customize the display format for dates and times.', 'booking' ),
386 'font_icon' => 'wpbc-bi-braces-asterisk _icn_password',
387 'font_icon_right' => 'wpbc-bi-question-circle',
388 'css_classes' => 'do_expand__' . $section_id . '_link',
389 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
390 'default' => false,
391 )
392 );
393
394 $section_id = 'wpbc_general_settings_permissions_metabox';
395 $subtabs['permissions'] = array_merge(
396 $subtab_default,
397 array(
398 'title' => __( 'Plugin Menu / Permissions', 'booking' ),
399 'page_title' => __( 'General Settings', 'booking' ),
400 'hint' => __( 'Set user permissions for accessing plugin menu pages and configure the menu position.', 'booking' ),
401 'font_icon' => 'wpbc-bi-key',
402 'font_icon_right' => 'wpbc-bi-question-circle',
403 'css_classes' => 'do_expand__' . $section_id . '_link',
404 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
405 'default' => false,
406 )
407 );
408
409 $section_id = 'wpbc_general_settings_translations_metabox';
410 $subtabs['translations'] = array_merge(
411 $subtab_default,
412 array(
413 'title' => __( 'Translations', 'booking' ),
414 'page_title' => __( 'General Settings', 'booking' ),
415 'hint' => __( 'Choose whether to use local translations or WordPress translations.', 'booking' ),
416 'font_icon' => 'wpbc_icn_translate 0wpbc-bi-translate',
417 'font_icon_right' => 'wpbc-bi-question-circle',
418 'css_classes' => 'do_expand__' . $section_id . '_link',
419 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
420 'default' => false,
421 )
422 );
423
424 $tabs['admin_panel']['subtabs'] = $subtabs;
425
426
427 // =============================================================================================================
428 // == Advanced ==
429 // =============================================================================================================
430 $tabs['advanced'] = array(
431 'is_show_top_path' => false, // true | false. By default value is: false.
432 'is_show_top_navigation' => false, // true | false. By default value is: false.
433 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
434 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
435 // translators: 1: Booking Calendar.
436 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
437 'title' => __( 'Advanced', 'booking' ), // Left Vertical Menu - Title.
438 // translators: 1: Booking Calendar.
439 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
440 'font_icon' => 'wpbc-bi-gear', // Left Vertical Menu - Icon.
441 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
442 'css_classes' => '', // CSS.
443 'icon' => '', // Icon - link to the real PNG img.
444 'default' => false, // Is this tab activated by default or not: true / false.
445 'folder_style' => 'order:1000',
446 );
447
448 $subtabs = array();
449
450 $section_id = 'wpbc_general_settings_advanced_metabox';
451 $subtabs['advanced_options'] = array_merge(
452 $subtab_default,
453 array(
454 'title' => __( 'Advanced Options', 'booking' ),
455 'page_title' => __( 'General Settings', 'booking' ),
456 'hint' => __( 'Configure loading of CSS/JavaScript files, set the number of simultaneous requests, and other advanced options.', 'booking' ),
457 'font_icon' => 'wpbc_icn_adjust',
458 'font_icon_right' => 'wpbc-bi-question-circle',
459 'css_classes' => 'do_expand__' . $section_id . '_link',
460 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
461 'default' => false,
462 )
463 );
464
465 $section_id = 'wpbc_general_settings_uninstall_metabox';
466 $subtabs['uninstall'] = array_merge(
467 $subtab_default,
468 array(
469 'title' => __( 'Uninstall / Deactivation', 'booking' ),
470 'page_title' => __( 'General Settings', 'booking' ),
471 'hint' => __( 'Enable the option to fully erase booking data when the plugin is deactivated.', 'booking' ),
472 'font_icon' => 'wpbc-bi-trash',
473 'font_icon_right' => 'wpbc-bi-question-circle',
474 'css_classes' => 'do_expand__' . $section_id . '_link',
475 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
476 'default' => false,
477 )
478 );
479
480 $section_id = 'wpbc_general_settings_information_metabox';
481 $subtabs['information'] = array_merge(
482 $subtab_default,
483 array(
484 'title' => __( 'Plugin Info & News', 'booking' ),
485 'page_title' => __( 'General Settings', 'booking' ),
486 'hint' => __( 'Stay informed with the latest news and details about the plugin.', 'booking' ),
487 'font_icon' => 'wpbc_icn_newspaper -bi-newspaper _icn_news 0wpbc-bi-translate',
488 'font_icon_right' => 'wpbc-bi-question-circle',
489 'css_classes' => 'do_expand__' . $section_id . '_link',
490 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
491 'default' => false,
492 )
493 );
494
495 $section_id = 'wpbc_general_settings_help_metabox';
496 $subtabs['tools'] = array_merge(
497 $subtab_default,
498 array(
499 'title' => __( 'Tools', 'booking' ),
500 'page_title' => __( 'General Settings', 'booking' ),
501 'hint' => '', //__( 'Stay informed with the latest news and details about the plugin. ', 'booking' ),
502 'font_icon' => 'wpbc_icn_construction',
503 'font_icon_right' => '',
504 'css_classes' => 'do_expand__' . $section_id . '_link',
505 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
506 'default' => false,
507 )
508 );
509 if ( class_exists('wpdev_bk_multiuser') ) {
510 $section_id = 'wpbc_general_settings_multiuser_metabox';
511 $subtabs['multiuser'] = array_merge(
512 $subtab_default,
513 array(
514 'title' => __( 'Multiuser Options', 'booking' ),
515 'page_title' => __( 'General Settings', 'booking' ),
516 'hint' => __( 'Multiuser Options', 'booking' ),
517 'font_icon' => 'wpbc_icn_people_alt',
518 'font_icon_right' => 'wpbc-bi-question-circle',
519 'css_classes' => 'do_expand__' . $section_id . '_link',
520 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
521 'default' => false,
522 )
523 );
524 }
525
526 $tabs['advanced']['subtabs'] = $subtabs;
527
528 // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:900;' ) );
529 // $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:1000;' ) );
530
531 return $tabs;
532 }
533
534
535 public function content() {
536
537 // Checking.
538
539 do_action( 'wpbc_hook_settings_page_header', 'general_settings' ); // Define Notices Section and show some static messages, if needed.
540
541 if ( ! wpbc_is_mu_user_can_be_here( 'activated_user' ) ) {
542 return false;
543 } // Check if MU user activated, otherwise show Warning message.
544
545 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) {
546 return false;
547 } // User is not Super admin, so exit. Basically its was already checked at the bottom of the PHP file, just in case.
548
549 // Redirect legacy Settings > Availability links to the dedicated General Availability page.
550 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
551 if ( ( ! empty( $_GET['scroll_to_section'] ) ) && ( 'wpbc_general_settings_availability_tab' === sanitize_text_field( wp_unslash( $_GET['scroll_to_section'] ) ) ) ) {
552 wpbc_redirect( function_exists( 'wpbc_get_general_availability_url' ) ? wpbc_get_general_availability_url() : admin_url( 'admin.php?page=wpbc-availability&tab=general_availability' ) );
553 return;
554 }
555
556 $is_can = apply_bk_filter( 'recheck_version', true );
557 if ( ! $is_can ) {
558 ?>
559 <script type="text/javascript"> jQuery(document).ready(function () {
560 jQuery('.wpdvlp-sub-tabs').remove();
561 });
562 </script>
563 <?php
564 return;
565 }
566
567
568 // Init Settings API & Get Data from DB.
569 $this->settings_api(); // Define all fields and get values from DB.
570
571 // Submit .
572
573 $submit_form_name = 'wpbc_general_settings_form'; // Define form name.
574
575 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
576 if ( isset( $_POST[ 'is_form_sbmitted_' . $submit_form_name ] ) ) {
577
578 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }.
579 $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.
580
581 // Save Changes .
582 $this->update();
583 }
584 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
585 if ( ! empty( $_GET['scroll_to_section'] ) ) {
586 ?>
587 <script type="text/javascript">
588 jQuery(document).ready(function () {
589 jQuery('#<?php echo esc_js( sanitize_text_field( wp_unslash( $_GET['scroll_to_section'] ) ) ); ?> a').trigger('click');
590 });
591 </script>
592 <?php
593 }
594
595 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
596 if ( ( isset( $_GET['wpbc_setup_wizard'] ) ) && ( 'reset' === $_GET['wpbc_setup_wizard'] ) ) {
597
598 wpbc_setup_wizard_page__force_in_get();
599
600 ?>
601 <div class="wpdvlp-sub-tabs wpbc_redirection_message" style="margin: 20px 0;padding: 1em;font-size: 14px;">
602 <a href="<?php echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>">Redirect</a> after <span class="wpbc_countdown">1</span> second...</div>
603 <?php
604
605 wpbc_redirect( wpbc_get_setup_wizard_page_url() );
606 }
607
608 // JavaScript: Tooltips, Popover, Datepick (js & css) .
609 echo '<span class="wpdevelop">';
610 wpbc_js_for_bookings_page();
611 echo '</span>';
612
613 // TODO: 2025-05-05 update in real top path. wpbc_ui_settings__top_path();
614
615 // Content .
616 ?>
617 <div class="clear"></div>
618 <div class="wpbc_settings_flex_container">
619
620 <div class="wpbc_settings_flex_container_left" style="display:none;">
621
622 <div class="wpbc_settings_navigation_column">
623
624 <div id="wpbc_general_settings_dashboard_tab" class="wpbc_settings_navigation_item wpbc_settings_navigation_item_active">
625 <?php
626 $title = esc_attr__( 'Dashboard', 'booking' );
627 ?>
628 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_js( $title ); ?>' );"
629 href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
630 </div>
631 <div id="wpbc_general_settings_calendar_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
632 <?php
633 $title = esc_attr__( 'Calendar', 'booking' );
634 ?>
635 <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>
636 </div>
637 <div id="wpbc_general_settings_days_tooltips_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
638 <?php
639 $title = esc_attr__( 'Tooltips in days', 'booking' );
640 ?>
641 <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>
642 </div>
643 <div id="wpbc_general_settings_availability_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
644 <?php
645 $title = esc_attr__( 'Availability', 'booking' );
646 ?>
647 <a href="<?php echo esc_url( function_exists( 'wpbc_get_general_availability_url' ) ? wpbc_get_general_availability_url() : admin_url( 'admin.php?page=wpbc-availability&tab=general_availability' ) ); ?>"><span><?php echo esc_html( $title ); ?></span></a>
648 </div>
649 <div id="wpbc_general_settings_capacity_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
650 <?php
651 $title = esc_attr__( 'Capacity', 'booking' );
652 ?>
653 <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>
654 </div>
655 <div id="wpbc_general_settings_form_tab" class="wpbc_settings_navigation_item">
656 <?php
657 $title = esc_attr__( 'Form Options', 'booking' );
658 ?>
659 <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>
660 </div>
661 <div id="wpbc_general_settings_time_slots_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
662 <?php
663 $title = esc_attr__( 'Time Slots', 'booking' );
664 ?>
665 <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>
666 </div>
667 <div id="wpbc_general_settings_booking_confirmation_tab" class="wpbc_settings_navigation_item">
668 <?php
669 $title = esc_attr__( 'Booking Confirmation', 'booking' );
670 ?>
671 <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>
672 </div>
673
674 <div id="wpbc_general_settings_booking_timeline_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
675 <?php
676 $title = esc_attr__( 'Timeline (front-end)', 'booking' );
677 ?>
678 <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>
679 </div>
680 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
681 <div id="wpbc_general_settings_bookings_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
682 <?php
683 $title = esc_attr__( 'Manage Bookings', 'booking' );
684 ?>
685 <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>
686 </div>
687 <?php } ?>
688
689 <?php if ( class_exists('wpdev_bk_biz_s') ) { ?>
690 <div id="wpbc_general_settings_auto_cancelation_approval_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
691 <?php
692 $title = esc_attr__( 'Auto Cancellation / Auto Approval', 'booking' );
693 ?>
694 <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>
695 </div>
696 <?php } ?>
697
698
699 <?php if ( class_exists('wpdev_bk_multiuser') ) { ?>
700 <div id="wpbc_general_settings_multiuser_tab" class="wpbc_settings_navigation_item">
701 <?php
702 $title = esc_attr__( 'Multiuser options', 'booking' );
703 ?>
704 <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>
705 </div>
706 <?php } ?>
707
708 <div id="wpbc_general_settings_booking_listing_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
709 <?php
710 $title = esc_attr__( 'Admin Panel', 'booking' );
711 ?>
712 <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>
713 </div>
714 <div id="wpbc_general_settings_booking_calendar_overview_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
715 <?php
716 $title = esc_attr__( 'Timeline View', 'booking' );
717 ?>
718 <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>
719 </div>
720 <div id="wpbc_general_settings_datestimes_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
721 <?php
722 $title = esc_attr__( 'Date / Time Formats', 'booking' );
723 ?>
724 <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>
725 </div>
726 <div id="wpbc_general_settings_permissions_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
727 <?php
728 $title = esc_attr__( 'Plugin Menu / Permissions', 'booking' );
729 ?>
730 <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>
731 </div>
732 <div id="wpbc_general_settings_translations_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
733 <?php
734 $title = esc_attr__( 'Translations', 'booking' );
735 ?>
736 <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>
737 </div>
738 <div id="wpbc_general_settings_advanced_tab" class="wpbc_settings_navigation_item">
739 <?php
740 $title = esc_attr__( 'Advanced', 'booking' );
741 ?>
742 <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>
743 </div>
744 <div id="wpbc_general_settings_uninstall_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
745 <?php
746 $title = esc_attr__( 'Uninstall / deactivation', 'booking' );
747 ?>
748 <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>
749 </div>
750 <div id="wpbc_general_settings_information_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
751 <?php
752 $title = esc_attr__( 'Info / News', 'booking' );
753 ?>
754 <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>
755 </div>
756 <?php if ( ( class_exists('wpdev_bk_personal') ) && ( ! wpbc_is_this_demo() ) ) { ?>
757 <div id="wpbc_general_settings_help_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
758 <?php
759 $title = esc_attr__( 'Tools', 'booking' );
760 ?>
761 <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>
762 </div>
763 <?php } ?>
764
765 <div id="wpbc_general_settings_all_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
766 <?php
767 $title = esc_attr__( 'Show All Settings', 'booking' );
768 ?>
769 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_all_tab a' ,'.postbox', '<?php echo esc_js( $title ); ?>' );"
770 href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
771 </div>
772
773 </div>
774
775 </div>
776 <div class="wpbc_settings_flex_container_right">
777
778 <span class="metabox-holder">
779 <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post">
780 <?php
781 // N o n c e field, and key for checking S u b m i t.
782 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
783 ?>
784 <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"/>
785 <input type="hidden" name="form_visible_section" id="form_visible_section" value=""/>
786
787 <?php
788 if ( wpbc_is_show_general_setting_options() ) {
789 // FixIn: 8.9.4.11.
790 ?>
791
792 <div class="wpbc_settings_row wpbc_settings_row_full_width" >
793
794 <div id="wpbc_general_settings_dashboard_metabox" class="postbox"
795 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 ) ); ?>
796 <?php
797
798 wpbc_ui_settings__panel__statistic();
799
800 wpbc_ui_settings__panel__all_settings_panels();
801
802 wpbc_ui_settings__panel__plugin_version();
803
804 ?></div><?php //wpbc_close_meta_box_section(); ?>
805
806
807 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_calendar', __('Calendar', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
808
809 <?php $this->settings_api()->show( 'calendar' ); ?>
810
811 <?php wpbc_close_meta_box_section(); ?>
812
813
814 <?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 ) ); ?>
815
816 <?php $this->settings_api()->show( 'days_tooltips' ); ?>
817
818 <?php wpbc_close_meta_box_section(); ?>
819
820
821 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_availability', __('Availability', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
822
823 <?php $this->settings_api()->show( 'availability' ); ?>
824
825 <?php wpbc_close_meta_box_section(); ?>
826
827
828 <?php
829 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation',
830 __( 'Booking Confirmation', 'booking' ),
831 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
832 $this->settings_api()->show( 'booking_confirmation' );
833 wpbc_close_meta_box_section();
834 ?>
835 <div class="wpbc_settings_row wpbc_settings_row_left">
836 <?php
837 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_left',
838 __( 'Section', 'booking' ) . ': ' . __( 'Personal Information', 'booking' ),
839 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
840 $this->settings_api()->show( 'booking_confirmation_left' );
841 wpbc_close_meta_box_section();
842
843 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_right',
844 __( 'Section', 'booking' ) . ': ' . __( 'Booking details', 'booking' ),
845 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
846 $this->settings_api()->show( 'booking_confirmation_right' );
847 wpbc_close_meta_box_section();
848 ?>
849 </div>
850 <div class="wpbc_settings_row wpbc_settings_row_right">
851 <?php
852 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_help',
853 __( 'Shortcodes', 'booking' ),
854 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
855 $this->settings_api()->show( 'booking_confirmation_help' );
856 wpbc_close_meta_box_section();
857 ?>
858 </div>
859 <div class="clear"></div>
860
861 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
862 <?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 ) ); ?>
863
864 <?php $this->settings_api()->show( 'bookings_options' ); ?>
865
866 <?php wpbc_close_meta_box_section(); ?>
867 <?php } ?>
868
869
870 <?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 ) ); ?>
871
872 <?php $this->settings_api()->show( 'booking_listing' ); ?>
873
874 <?php wpbc_close_meta_box_section(); ?>
875
876
877 <?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 ) ); ?>
878
879 <?php // FixIn: 8.5.2.20.
880 $this->settings_api()->show( 'booking_calendar_overview' );
881 ?>
882
883 <?php wpbc_close_meta_box_section(); ?>
884
885
886 <?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 ) ); ?>
887
888 <?php
889 $this->settings_api()->show( 'booking_timeline' );
890 ?>
891
892 <?php wpbc_close_meta_box_section(); ?>
893
894
895 <?php if ( class_exists('wpdev_bk_biz_s') ) { ?>
896
897
898 <?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 ) ); ?>
899
900 <?php $this->settings_api()->show( 'auto_cancelation_approval' ); ?>
901
902 <?php wpbc_close_meta_box_section(); ?>
903
904 <?php } ?>
905
906
907
908 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_capacity', __('Capacity', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
909
910 <?php $this->settings_api()->show( 'capacity' ); ?>
911
912 <?php wpbc_close_meta_box_section(); ?>
913
914
915 <?php
916 if ( ! class_exists( 'wpdev_bk_personal' ) ) {
917
918 $wpbc_metabox_id = 'wpbc_general_settings_capacity_upgrade';
919
920 ob_start();
921 $is_panel_visible = wpbc_is_dismissed( $wpbc_metabox_id . '_metabox', array(
922 'title' => '<i class="menu_icon icon-1x wpbc_icn_close"></i> ',
923 'hint' => __( 'Dismiss', 'booking' ),
924 'class' => 'wpbc_panel_get_started_dismiss',
925 'css' => 'background: #fff;border-radius: 7px;'
926 ));
927 ?>
928 <script type="text/javascript"> jQuery('#<?php echo esc_js( $wpbc_metabox_id ); ?>_metabox').hide(); </script>
929 <?php
930 $dismiss_button_content = ob_get_clean();
931
932 if ( $is_panel_visible ) {
933
934 wpbc_open_meta_box_section( $wpbc_metabox_id,
935 __('Booking Quantity Control - Set limits for the number of bookings per day or time slot.', 'booking'),
936 array( 'is_section_visible_after_load' => false,
937 'is_show_minimize' => false,
938 'dismiss_button' => $dismiss_button_content
939 ) );
940
941 $this->settings_api()->show( 'capacity_upgrade' );
942
943 wpbc_close_meta_box_section();
944 }
945 }
946 ?>
947
948
949 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_advanced', __('Advanced', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
950
951 <?php $this->settings_api()->show( 'advanced' ); ?>
952
953 <?php wpbc_close_meta_box_section(); ?>
954
955
956 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_information', __('Information', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
957
958 <?php $this->settings_api()->show( 'information' ); ?>
959
960 <?php wpbc_close_meta_box_section(); ?>
961
962
963
964 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_datestimes', __('Date : Time', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
965
966 <?php $this->settings_api()->show( 'date_time' ); ?>
967
968 <?php wpbc_close_meta_box_section(); ?>
969
970
971
972 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_permissions', __('Plugin Menu', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
973
974 <?php $this->settings_api()->show( 'permissions' ); ?>
975
976 <?php wpbc_close_meta_box_section(); ?>
977
978
979 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_uninstall', __('Uninstall / deactivation', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
980
981 <?php $this->settings_api()->show( 'uninstall' ); ?>
982
983 <?php wpbc_close_meta_box_section(); ?>
984
985 <?php if ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! wpbc_is_this_demo() ) ) { ?>
986 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_help', __( 'Tools', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
987
988 <?php $this->settings_api()->show( 'help' ); ?>
989
990 <?php wpbc_close_meta_box_section(); ?>
991 <?php } ?>
992
993 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_translations', __( 'Translations', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
994
995 <?php $this->settings_api()->show( 'translations' ); ?>
996
997 <?php wpbc_translation_buttons_settings_section(); ?>
998
999 <?php wpbc_close_meta_box_section(); ?>
1000
1001 <?php if ( class_exists( 'wpdev_bk_multiuser' ) ) { // FixIn: 9.2.3.8. ?>
1002
1003 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_multiuser', __( 'Multiuser options', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
1004
1005 <?php $this->settings_api()->show( 'multiuser' ); ?>
1006
1007 <?php wpbc_close_meta_box_section(); ?>
1008
1009 <?php } ?>
1010
1011 </div>
1012 <div class="clear"></div>
1013 <div class="container_for_save_buttons">
1014 <input type="submit" value="<?php esc_attr_e( 'Save Changes', 'booking' ); ?>" class="button button-primary wpbc_submit_button"/>
1015 <span class="sub_right">
1016 <a style="margin:0;" class="button button"
1017 onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_all_tab a' ,'.postbox', 'Show All Settings' );"
1018 href="javascript:void(0);">
1019 <?php
1020 esc_html_e( 'Show All Settings', 'booking' )
1021 ?>
1022 </a>
1023 <?php
1024 if ( 'translations_updated_from_wpbc_and_wp' !== get_bk_option( 'booking_translation_update_status' ) ) {
1025
1026 $current_locale = wpbc_get_maybe_reloaded_booking_locale();
1027
1028 if ( ! in_array( $current_locale, array( 'en_US', 'en_CA', 'en_GB', 'en_AU' ), true ) ) {
1029
1030 echo '<a class="button button" href="'
1031 . 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' )
1032 . '">'
1033 . esc_html__( 'Update Translations', 'booking' )
1034 . '</a>';
1035 }
1036 }
1037
1038 if ( ! wpbc_is_this_demo() ) {
1039
1040 echo '<a style="margin:0 2em;" class="button button" href="'
1041 . 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' )
1042 . '">'
1043 . esc_html__( 'Restore all dismissed windows', 'booking' )
1044 . '</a>';
1045 }
1046 ?>
1047 </span>
1048 </div>
1049
1050 <?php } ?>
1051 </form>
1052 </span>
1053
1054 </div>
1055 </div>
1056
1057
1058 <?php
1059
1060 do_action( 'wpbc_hook_settings_page_footer', 'general_settings' );
1061 }
1062
1063
1064 public function update() {
1065
1066 $validated_fields = $this->settings_api()->validate_post(); // Get Validated Settings fields in $_POST request.
1067
1068 $validated_fields = apply_filters( 'wpbc_settings_validate_fields_before_saving', $validated_fields ); // Hook for validated fields.
1069
1070 /**
1071 * Skip saving specific option, for example in Demo mode.
1072 * // unset( $validated_fields['booking_start_day_weeek'] );
1073 */
1074
1075 // FixIn: 9.8.6.1.
1076 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
1077 if ( ! empty( $_POST['form_visible_section'] ) ) {
1078 ?>
1079 <script type="text/javascript">
1080 jQuery(document).ready(function () {
1081 jQuery('<?php
1082 // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1083 echo esc_js( $_POST['form_visible_section'] );
1084 ?> a').trigger('click');
1085 });
1086 </script>
1087 <?php
1088 }
1089
1090 $this->settings_api()->save_to_db( $validated_fields ); // Save fields to DB.
1091
1092 wpbc_show_changes_saved_message();
1093
1094 /**
1095 * // O L D W A Y: Saving Fields Data
1096 * // update_bk_option( 'booking_is_delete_if_deactive'
1097 * // , WPBC_Settings_API::validate_checkbox_post('booking_is_delete_if_deactive') );
1098 * // ( (isset( $_POST['booking_is_delete_if_deactive'] ))?'On':'Off') );
1099 */
1100 }
1101 }
1102
1103
1104 /**
1105 *
1106
1107 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
1108
1109 if ( ( ! isset( $ _GET['tab'] ) ) || ( $_GET['tab'] == 'general' ) ) { // If tab was not selected or selected default, then redirect it to the "form" tab.
1110 $_GET['tab'] = 'form';
1111 }
1112 } else {
1113 add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu
1114 }
1115 */
1116
1117 add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu
1118
1119