PluginProbe
Booking Calendar / 11.8.3
Booking Calendar v11.8.3
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
← All changes | core/admin/page-settings.php +81 -87 11.311.8.3 View file →
@@ -1,4 +1,4 @@
1 1 <?php /**
2 2 * @version 1.0
3 3 * @package Booking Calendar
4 4 * @category Content of Settings page
@@ -25,13 +25,14 @@
25 25 * Link to Settings API obj
26 26 *
27 27 * @var bool
28 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
29 + private $settings_api = false;
30 +
31 + public function __construct() {
32 + $this->normalize_legacy_settings_request();
33 +
34 + 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 35 // If tab was not selected or selected default, then redirect it to the "form" tab.
35 36 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
36 37 if ( ( isset( $_REQUEST['page'] ) && ( 'wpbc-settings' === $_REQUEST['page'] ) ) && ( ( ! isset( $_REQUEST['tab'] ) ) || ( 'general' === $_REQUEST['tab'] ) ) ) {
37 38 $_REQUEST['tab'] = 'form';
@@ -37,10 +38,43 @@
37 38 $_REQUEST['tab'] = 'form';
38 39 }
39 40 } else {
40 41 parent::__construct();
41 - }
42 - }
42 + }
43 + }
44 +
45 + /**
46 + * Route settings links for sections that were moved into the Advanced group.
47 + *
48 + * Existing bookmarks and integrations can continue using the former Admin
49 + * Panel group and the previous Manage Bookings location of the front-end
50 + * Timeline settings. Subtab identifiers remain unchanged.
51 + *
52 + * @return void
53 + */
54 + private function normalize_legacy_settings_request() {
55 + $request_page = isset( $_REQUEST['page'] ) && is_scalar( $_REQUEST['page'] )
56 + ? sanitize_key( (string) wp_unslash( $_REQUEST['page'] ) )
57 + : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
58 + $request_tab = isset( $_REQUEST['tab'] ) && is_scalar( $_REQUEST['tab'] )
59 + ? sanitize_key( (string) wp_unslash( $_REQUEST['tab'] ) )
60 + : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
61 + $request_subtab = isset( $_REQUEST['subtab'] ) && is_scalar( $_REQUEST['subtab'] )
62 + ? sanitize_key( (string) wp_unslash( $_REQUEST['subtab'] ) )
63 + : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
64 +
65 + $is_legacy_admin_panel = 'admin_panel' === $request_tab;
66 + $is_legacy_timeline = 'manage_bookings' === $request_tab && 'booking_timeline' === $request_subtab;
67 +
68 + if ( 'wpbc-settings' !== $request_page || ( ! $is_legacy_admin_panel && ! $is_legacy_timeline ) ) {
69 + return;
70 + }
71 +
72 + $_REQUEST['tab'] = 'advanced'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
73 + if ( isset( $_GET['tab'] ) ) {
74 + $_GET['tab'] = 'advanced'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
75 + }
76 + }
43 77
44 78 public function in_page() {
45 79
46 80 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.
@@ -154,10 +188,10 @@
154 188 );
155 189
156 190 $subtabs = array();
157 191
158 - $section_id = 'wpbc_general_settings_booking_timeline_metabox';
159 - $subtabs['booking_timeline'] = array_merge(
192 + $section_id = 'wpbc_general_settings_booking_timeline_metabox';
193 + $booking_timeline_subtab = array_merge(
160 194 $subtab_default,
161 195 array(
162 196 'title' => __( 'Timeline (front-end)', 'booking' ),
163 197 'page_title' => __( 'General Settings', 'booking' ),
@@ -245,9 +279,9 @@
245 279 )
246 280 );
247 281
248 282 $section_id = 'wpbc_general_settings_booking_calendar_overview_metabox';
249 - $subtabs['booking_calendar_overview'] = array_merge(
283 + $subtabs['booking_calendar_overview'] = array_merge(
250 284 $subtab_default,
251 285 array(
252 286 'title' => __( 'Timeline View (Back-End)', 'booking' ),
253 287 'page_title' => __( 'General Settings', 'booking' ),
@@ -257,11 +291,13 @@
257 291 'css_classes' => 'do_expand__' . $section_id . '_link',
258 292 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
259 293 'default' => false,
260 294 )
261 - );
262 -
263 - $section_id = 'wpbc_general_settings_datestimes_metabox';
295 + );
296 +
297 + $subtabs['booking_timeline'] = $booking_timeline_subtab;
298 +
299 + $section_id = 'wpbc_general_settings_datestimes_metabox';
264 300 $subtabs['datestimes'] = array_merge(
265 301 $subtab_default,
266 302 array(
267 303 'title' => __( 'Date and Time Formats', 'booking' ),
@@ -304,9 +340,11 @@
304 340 'default' => false,
305 341 )
306 342 );
307 343
308 - $tabs['admin_panel']['subtabs'] = $subtabs;
344 + $tabs['admin_panel']['subtabs'] = $subtabs;
345 + $admin_panel_subtabs = $subtabs;
346 + unset( $tabs['admin_panel'] );
309 347
310 348
311 349 // =============================================================================================================
312 350 // == Advanced ==
@@ -389,27 +427,10 @@
389 427 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
390 428 'default' => false,
391 429 )
392 430 );
393 - if ( class_exists('wpdev_bk_multiuser') ) {
394 - $section_id = 'wpbc_general_settings_multiuser_metabox';
395 - $subtabs['multiuser'] = array_merge(
396 - $subtab_default,
397 - array(
398 - 'title' => __( 'Multiuser Options', 'booking' ),
399 - 'page_title' => __( 'General Settings', 'booking' ),
400 - 'hint' => __( 'Multiuser Options', 'booking' ),
401 - 'font_icon' => 'wpbc_icn_people_alt',
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 - }
431 + $tabs['advanced']['subtabs'] = array_merge( $admin_panel_subtabs, $subtabs );
409 432
410 - $tabs['advanced']['subtabs'] = $subtabs;
411 -
412 433 // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:900;' ) );
413 434 // $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:1000;' ) );
414 435
415 436 return $tabs;
@@ -518,41 +539,23 @@
518 539 <div class="wpbc_settings_flex_container_left" style="display:none;">
519 540
520 541 <div class="wpbc_settings_navigation_column">
521 542
522 - <div id="wpbc_general_settings_dashboard_tab" class="wpbc_settings_navigation_item wpbc_settings_navigation_item_active">
523 - <?php
524 - $title = esc_attr__( 'Dashboard', 'booking' );
525 - ?>
526 - <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_js( $title ); ?>' );"
527 - href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
528 - </div>
529 - <div id="wpbc_general_settings_form_tab" class="wpbc_settings_navigation_item">
530 - <?php
531 - $title = esc_attr__( 'Form Options', 'booking' );
532 - ?>
533 - <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>
534 - </div>
535 - <div id="wpbc_general_settings_time_slots_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
536 - <?php
537 - $title = esc_attr__( 'Time Slots', 'booking' );
538 - ?>
539 - <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>
540 - </div>
541 - <div id="wpbc_general_settings_booking_confirmation_tab" class="wpbc_settings_navigation_item">
542 - <?php
543 - $title = esc_attr__( 'Booking Confirmation', 'booking' );
544 - ?>
543 + <div id="wpbc_general_settings_dashboard_tab" class="wpbc_settings_navigation_item wpbc_settings_navigation_item_active">
544 + <?php
545 + $title = esc_attr__( 'Dashboard', 'booking' );
546 + ?>
547 + <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_js( $title ); ?>' );"
548 + href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
549 + </div>
550 + <div id="wpbc_general_settings_booking_confirmation_tab" class="wpbc_settings_navigation_item">
551 + <?php
552 + $title = esc_attr__( 'Booking Confirmation', 'booking' );
553 + ?>
545 554 <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>
546 555 </div>
547 556
548 - <div id="wpbc_general_settings_booking_timeline_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
549 - <?php
550 - $title = esc_attr__( 'Timeline (front-end)', 'booking' );
551 - ?>
552 - <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>
553 - </div>
554 - <?php if ( class_exists('wpdev_bk_personal') ) { ?>
557 + <?php if ( class_exists('wpdev_bk_personal') ) { ?>
555 558 <div id="wpbc_general_settings_bookings_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
556 559 <?php
557 560 $title = esc_attr__( 'Manage Bookings', 'booking' );
558 561 ?>
@@ -569,17 +572,8 @@
569 572 </div>
570 573 <?php } ?>
571 574
572 575
573 - <?php if ( class_exists('wpdev_bk_multiuser') ) { ?>
574 - <div id="wpbc_general_settings_multiuser_tab" class="wpbc_settings_navigation_item">
575 - <?php
576 - $title = esc_attr__( 'Multiuser options', 'booking' );
577 - ?>
578 - <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>
579 - </div>
580 - <?php } ?>
581 -
582 576 <div id="wpbc_general_settings_booking_listing_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
583 577 <?php
584 578 $title = esc_attr__( 'Admin Panel', 'booking' );
585 579 ?>
@@ -588,11 +582,17 @@
588 582 <div id="wpbc_general_settings_booking_calendar_overview_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
589 583 <?php
590 584 $title = esc_attr__( 'Timeline View', 'booking' );
591 585 ?>
592 - <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>
593 - </div>
594 - <div id="wpbc_general_settings_datestimes_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
586 + <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>
587 + </div>
588 + <div id="wpbc_general_settings_booking_timeline_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
589 + <?php
590 + $title = esc_attr__( 'Timeline (front-end)', 'booking' );
591 + ?>
592 + <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>
593 + </div>
594 + <div id="wpbc_general_settings_datestimes_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
595 595 <?php
596 596 $title = esc_attr__( 'Date / Time Formats', 'booking' );
597 597 ?>
598 598 <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>
@@ -793,11 +793,15 @@
793 793
794 794 <?php if ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! wpbc_is_this_demo() ) ) { ?>
795 795 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_help', __( 'Tools', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
796 796
797 - <?php $this->settings_api()->show( 'help' ); ?>
798 -
799 - <?php wpbc_close_meta_box_section(); ?>
797 + <?php $this->settings_api()->show( 'help' ); ?>
798 +
799 + <?php if ( function_exists( 'wpbc_customer_access_render_rate_limit_reset_tool' ) ) { ?>
800 + <?php wpbc_customer_access_render_rate_limit_reset_tool(); ?>
801 + <?php } ?>
802 +
803 + <?php wpbc_close_meta_box_section(); ?>
800 804 <?php } ?>
801 805
802 806 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_translations', __( 'Translations', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
803 807
@@ -805,18 +809,8 @@
805 809
806 810 <?php wpbc_translation_buttons_settings_section(); ?>
807 811
808 812 <?php wpbc_close_meta_box_section(); ?>
809 -
810 - <?php if ( class_exists( 'wpdev_bk_multiuser' ) ) { // FixIn: 9.2.3.8. ?>
811 -
812 - <?php wpbc_open_meta_box_section( 'wpbc_general_settings_multiuser', __( 'Multiuser options', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
813 -
814 - <?php $this->settings_api()->show( 'multiuser' ); ?>
815 -
816 - <?php wpbc_close_meta_box_section(); ?>
817 -
818 - <?php } ?>
819 813
820 814 </div>
821 815 <div class="clear"></div>
822 816 <div class="container_for_save_buttons">