PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
← All changes | core/admin/page-settings.php +82 -101 11.3 → 11.9 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;
@@ -489,22 +510,9 @@
489 510 </script>
490 511 <?php
491 512 }
492 513
493 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
494 - if ( ( isset( $_GET['wpbc_setup_wizard'] ) ) && ( 'reset' === $_GET['wpbc_setup_wizard'] ) ) {
495 -
496 - wpbc_setup_wizard_page__force_in_get();
497 -
498 - ?>
499 - <div class="wpdvlp-sub-tabs wpbc_redirection_message" style="margin: 20px 0;padding: 1em;font-size: 14px;">
500 - <a href="<?php echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>">Redirect</a> after <span class="wpbc_countdown">1</span> second...</div>
501 - <?php
502 -
503 - wpbc_redirect( wpbc_get_setup_wizard_page_url() );
504 - }
505 -
506 - // JavaScript: Tooltips, Popover, Datepick (js & css) .
514 + // JavaScript: Tooltips, Popover, Datepick (js & css) .
507 515 echo '<span class="wpdevelop">';
508 516 wpbc_js_for_bookings_page();
509 517 echo '</span>';
510 518
@@ -518,41 +526,23 @@
518 526 <div class="wpbc_settings_flex_container_left" style="display:none;">
519 527
520 528 <div class="wpbc_settings_navigation_column">
521 529
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 - ?>
530 + <div id="wpbc_general_settings_dashboard_tab" class="wpbc_settings_navigation_item wpbc_settings_navigation_item_active">
531 + <?php
532 + $title = esc_attr__( 'Dashboard', 'booking' );
533 + ?>
534 + <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_js( $title ); ?>' );"
535 + href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
536 + </div>
537 + <div id="wpbc_general_settings_booking_confirmation_tab" class="wpbc_settings_navigation_item">
538 + <?php
539 + $title = esc_attr__( 'Booking Confirmation', 'booking' );
540 + ?>
545 541 <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 542 </div>
547 543
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') ) { ?>
544 + <?php if ( class_exists('wpdev_bk_personal') ) { ?>
555 545 <div id="wpbc_general_settings_bookings_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
556 546 <?php
557 547 $title = esc_attr__( 'Manage Bookings', 'booking' );
558 548 ?>
@@ -569,17 +559,8 @@
569 559 </div>
570 560 <?php } ?>
571 561
572 562
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 563 <div id="wpbc_general_settings_booking_listing_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
583 564 <?php
584 565 $title = esc_attr__( 'Admin Panel', 'booking' );
585 566 ?>
@@ -588,11 +569,17 @@
588 569 <div id="wpbc_general_settings_booking_calendar_overview_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
589 570 <?php
590 571 $title = esc_attr__( 'Timeline View', 'booking' );
591 572 ?>
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">
573 + <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>
574 + </div>
575 + <div id="wpbc_general_settings_booking_timeline_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
576 + <?php
577 + $title = esc_attr__( 'Timeline (front-end)', 'booking' );
578 + ?>
579 + <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>
580 + </div>
581 + <div id="wpbc_general_settings_datestimes_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
595 582 <?php
596 583 $title = esc_attr__( 'Date / Time Formats', 'booking' );
597 584 ?>
598 585 <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 +780,15 @@
793 780
794 781 <?php if ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! wpbc_is_this_demo() ) ) { ?>
795 782 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_help', __( 'Tools', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
796 783
797 - <?php $this->settings_api()->show( 'help' ); ?>
798 -
799 - <?php wpbc_close_meta_box_section(); ?>
784 + <?php $this->settings_api()->show( 'help' ); ?>
785 +
786 + <?php if ( function_exists( 'wpbc_customer_access_render_rate_limit_reset_tool' ) ) { ?>
787 + <?php wpbc_customer_access_render_rate_limit_reset_tool(); ?>
788 + <?php } ?>
789 +
790 + <?php wpbc_close_meta_box_section(); ?>
800 791 <?php } ?>
801 792
802 793 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_translations', __( 'Translations', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
803 794
@@ -805,18 +796,8 @@
805 796
806 797 <?php wpbc_translation_buttons_settings_section(); ?>
807 798
808 799 <?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 800
820 801 </div>
821 802 <div class="clear"></div>
822 803 <div class="container_for_save_buttons">