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 +71 -78 11.4 → 11.9 View file →
@@ -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
@@ -532,15 +540,9 @@
532 540 ?>
533 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>
534 542 </div>
535 543
536 - <div id="wpbc_general_settings_booking_timeline_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
537 - <?php
538 - $title = esc_attr__( 'Timeline (front-end)', 'booking' );
539 - ?>
540 - <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>
541 - </div>
542 - <?php if ( class_exists('wpdev_bk_personal') ) { ?>
544 + <?php if ( class_exists('wpdev_bk_personal') ) { ?>
543 545 <div id="wpbc_general_settings_bookings_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
544 546 <?php
545 547 $title = esc_attr__( 'Manage Bookings', 'booking' );
546 548 ?>
@@ -557,17 +559,8 @@
557 559 </div>
558 560 <?php } ?>
559 561
560 562
561 - <?php if ( class_exists('wpdev_bk_multiuser') ) { ?>
562 - <div id="wpbc_general_settings_multiuser_tab" class="wpbc_settings_navigation_item">
563 - <?php
564 - $title = esc_attr__( 'Multiuser options', 'booking' );
565 - ?>
566 - <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>
567 - </div>
568 - <?php } ?>
569 -
570 563 <div id="wpbc_general_settings_booking_listing_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
571 564 <?php
572 565 $title = esc_attr__( 'Admin Panel', 'booking' );
573 566 ?>
@@ -576,11 +569,17 @@
576 569 <div id="wpbc_general_settings_booking_calendar_overview_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
577 570 <?php
578 571 $title = esc_attr__( 'Timeline View', 'booking' );
579 572 ?>
580 - <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>
581 - </div>
582 - <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">
583 582 <?php
584 583 $title = esc_attr__( 'Date / Time Formats', 'booking' );
585 584 ?>
586 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>
@@ -781,11 +780,15 @@
781 780
782 781 <?php if ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! wpbc_is_this_demo() ) ) { ?>
783 782 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_help', __( 'Tools', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
784 783
785 - <?php $this->settings_api()->show( 'help' ); ?>
786 -
787 - <?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(); ?>
788 791 <?php } ?>
789 792
790 793 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_translations', __( 'Translations', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
791 794
@@ -793,18 +796,8 @@
793 796
794 797 <?php wpbc_translation_buttons_settings_section(); ?>
795 798
796 799 <?php wpbc_close_meta_box_section(); ?>
797 -
798 - <?php if ( class_exists( 'wpdev_bk_multiuser' ) ) { // FixIn: 9.2.3.8. ?>
799 -
800 - <?php wpbc_open_meta_box_section( 'wpbc_general_settings_multiuser', __( 'Multiuser options', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
801 -
802 - <?php $this->settings_api()->show( 'multiuser' ); ?>
803 -
804 - <?php wpbc_close_meta_box_section(); ?>
805 -
806 - <?php } ?>
807 800
808 801 </div>
809 802 <div class="clear"></div>
810 803 <div class="container_for_save_buttons">