PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
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 10.11 All 204 releases
← All changes | includes/page-form-builder/builder-form-page.php +21 -38 11.311.8.4 View file →
@@ -59,10 +59,12 @@
59 59 'is_show_top_navigation' => false, // true | false. By default value is: false.
60 60 'right_vertical_sidebar__is_show' => true, // true | false. By default value is: false.
61 61 'right_vertical_sidebar__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
62 62 'right_vertical_sidebar_compact__is_show' => true, // true | false. By default value is: false.
63 - 'left_navigation__default_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
64 - 'left_navigation__force_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. Force sidebar mode independently from user preference.
63 +// 'left_navigation__default_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
64 +// 'left_navigation__force_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. Force sidebar mode independently from user preference.
65 + 'left_navigation__default_view_mode' => 'max', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
66 + 'left_navigation__force_view_mode' => 'max', // '' | 'min' | 'compact' | 'max' | 'none'. Force sidebar mode independently from user preference.
65 67
66 68 'top_path_title' => __( 'Forms Builder', 'booking' ),
67 69 'title' => __( 'Forms Builder', 'booking' ), // Title of TAB.
68 70 'hint' => '', //__( 'Define available and unavailable days for your calendar(s).', 'booking' ), // Hint.
@@ -538,22 +540,20 @@
538 540 'data-wpbc-bfb-top-advanced-btn' => '1',
539 541 ),
540 542 ),
541 543 );
542 - if ( WPBC_BFB_DEBUG ) {
543 - $tabs_config['debug_tab'] = array(
544 - 'title' => __( 'Debug', 'booking' ),
545 - 'type' => 'panel',
546 - 'css_classes' => 'align_right small_debug_tab',
547 - 'hint' => array(
548 - 'title' => __( 'Show debug export outputs', 'booking' ),
549 - 'position' => 'top',
550 - ),
551 - );
552 - }
544 + $tabs_config['debug_tab'] = array(
545 + 'title' => __( 'Debug', 'booking' ),
546 + 'type' => 'panel',
547 + 'css_classes' => 'align_right small_debug_tab',
548 + 'hint' => array(
549 + 'title' => __( 'Show debug export outputs', 'booking' ),
550 + 'position' => 'top',
551 + ),
552 + );
553 +
553 554 $tabs_config = apply_filters( 'wpbc_bfb_ui__top_tabs', $tabs_config, array() );
554 555
555 - // $preferred_tab_id = ( 'On' === get_bk_option( 'booking_is_use_simple_booking_form' ) ) ? 'advanced_tab' : 'builder_tab';
556 556 $preferred_tab_id = 'builder_tab'; //TODO: make selection based on "bfb_options":{"advanced_mode_source":"builder"}
557 557 $active_tab_id = WPBC_BFB_UI_Top_Tabs::resolve_active_tab_id( $tabs_config, $preferred_tab_id );
558 558
559 559 WPBC_BFB_UI_Top_Tabs::render(
@@ -621,9 +621,8 @@
621 621 ?></div><?php
622 622
623 623 ?>
624 624 </div>
625 - <?php if ( WPBC_BFB_DEBUG ) { ?>
626 625 <!-- Debug Mode tab -->
627 626 <div class="wpbc_bfb__tab_section wpbc_bfb__tab_section__debug_tab wpbc_bfb__top_tab_section wpbc_bfb__top_tab_section__debug_tab"
628 627 <?php echo WPBC_BFB_UI_Top_Tabs::get_panel_hidden_attr( 'debug_tab', $active_tab_id ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>>
629 628
@@ -728,9 +727,8 @@
728 727 </div>
729 728
730 729 </div>
731 730 </div>
732 - <?php } ?>
733 731
734 732 <!-- Preview Section Content tab -->
735 733 <div class="wpbc_bfb__tab_section wpbc_bfb__tab_section__preview_tab wpbc_bfb__top_tab_section wpbc_bfb__top_tab_section__preview_tab"
736 734 <?php echo WPBC_BFB_UI_Top_Tabs::get_panel_hidden_attr( 'preview_tab', $active_tab_id ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>>
@@ -748,12 +746,12 @@
748 746
749 747 add_action( 'wpbc_menu_created', array( new WPBC_Page_Builder_Booking_Form(), '__construct' ) ); // Executed after creation of Menu.
750 748
751 749
752 -// == Temporary Migrate Functionality ==================================================================================
750 +// == One-way redirect from removed legacy form settings ===============================================================
753 751
754 752 /**
755 - * Disable showing Legacy "WP Booking Calendar > Settings > Booking Form > Booking Form Fields page" if enabled BFB.
753 + * Disable showing removed legacy "WP Booking Calendar > Settings > Booking Form" page.
756 754 *
757 755 * @param bool $is_show - 'usually' - true.
758 756 * @param string $page_tag - can be 'wpbc-settings'.
759 757 * @param string $active_page_tab - can be 'form'.
@@ -762,9 +760,9 @@
762 760 * @return false|mixed
763 761 */
764 762 function wpbc_form_fields__check__showing_page( $is_show, $page_tag, $active_page_tab, $active_page_subtab ) {
765 763
766 - if ( ( 'form' === $active_page_tab ) && ( 'wpbc-settings' === $page_tag ) && ( WPBC_Frontend_Settings::is_bfb_enabled( null ) ) ) {
764 + if ( ( 'form' === $active_page_tab ) && ( 'wpbc-settings' === $page_tag ) ) {
767 765 $is_show = false;
768 766 }
769 767
770 768 return $is_show;
@@ -773,9 +771,9 @@
773 771 add_filter( 'wpbc_before_showing_settings_page_is_show_page', 'wpbc_form_fields__check__showing_page', 20, 4 );
774 772
775 773
776 774 /**
777 - * Unset Form Menu in vertical left menu widget. - unset legacy form builder, if enabled BFB.
775 + * Unset removed legacy Form menu in vertical left menu widget.
778 776 *
779 777 * @param array $nav_tabs - array of menus.
780 778 * @param string $this_page - current selected page.
781 779 *
@@ -783,11 +781,9 @@
783 781 */
784 782 function wpbc_form_fields__check__plugin_menu_structure( $nav_tabs, $this_page ) {
785 783
786 784 if ( isset( $nav_tabs['wpbc-settings'] ) && isset( $nav_tabs['wpbc-settings']['form'] ) ) {
787 - if ( WPBC_Frontend_Settings::is_bfb_enabled( null ) ) {
788 - unset( $nav_tabs['wpbc-settings']['form'] );
789 - }
785 + unset( $nav_tabs['wpbc-settings']['form'] );
790 786 }
791 787
792 788 return $nav_tabs;
793 789 }
@@ -800,23 +796,10 @@
800 796 // $page_tag - here can be all defined in plugin menu pages. So we need to check activated page. By default its inside of $_GET['page'].
801 797 // Execute it only for WP Booking Calendar > Settings > Booking Form > Booking Form Fields page.
802 798
803 799 if ( wpbc_is_settings_form_page() ) {
804 - if ( WPBC_Frontend_Settings::is_bfb_enabled( null ) ) {
805 - // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
806 - wp_redirect( admin_url( "admin.php?page=wpbc-settings&tab=builder_booking_form" ) );
807 - // $_REQUEST['tab'] = 'builder_booking_form';
808 - // unset( $_REQUEST['subtab'] );
809 - // $_SERVER[ 'REQUEST_URI' ] = str_replace( '&subtab=form_options', '', $_SERVER[ 'REQUEST_URI' ] );
810 - // $_SERVER[ 'REQUEST_URI' ] = str_replace( 'tab=form', 'tab=builder_booking_form', $_SERVER[ 'REQUEST_URI' ] );
811 - }
812 - } elseif ( wpbc_is_settings_bfb_page() ) {
813 - if ( ! WPBC_Frontend_Settings::is_bfb_enabled( null ) ) {
814 - // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
815 - wp_redirect( admin_url( "admin.php?page=wpbc-settings&tab=form&subtab=form_options" ) );
816 - // $_REQUEST['tab'] = 'form';
817 - // $_SERVER[ 'REQUEST_URI' ] = str_replace( 'tab=builder_booking_form', 'tab=form', $_SERVER[ 'REQUEST_URI' ] );
818 - }
800 + // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
801 + wp_redirect( admin_url( "admin.php?page=wpbc-settings&tab=builder_booking_form" ) );
819 802 }
820 803 }
821 804 // We are set 9 to execute earlier than hook in WPBC_Admin_Menus.
822 805 add_action( 'wpbc_define_nav_tabs', 'wpbc_form_fields__check__define_page_redirect', 9 ); // This Hook fire in the class WPBC_Admin_Menus for showing page content of specific menu