| @@ -53,17 +53,21 @@ | ||
| 53 | 53 | |
| 54 | 54 | $tabs = array(); |
| 55 | 55 | $tabs['builder_booking_form'] = array( |
| 56 | 56 | 'is_default_full_screen' => true, // true | false. By default value is: false. |
| 57 | - 'is_show_top_path' => false, // true | false. By default value is: false. | |
| 57 | + 'is_force_full_screen' => true, // true | false. Force full screen independently from user preference. | |
| 58 | + 'is_show_top_path' => true, // true | false. By default value is: true. | |
| 58 | 59 | 'is_show_top_navigation' => false, // true | false. By default value is: false. |
| 59 | 60 | 'right_vertical_sidebar__is_show' => true, // true | false. By default value is: false. |
| 60 | 61 | 'right_vertical_sidebar__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. |
| 61 | 62 | 'right_vertical_sidebar_compact__is_show' => true, // true | false. By default value is: false. |
| 62 | - 'left_navigation__default_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. | |
| 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. | |
| 63 | 67 | |
| 64 | - 'title' => __( 'Forms Builder', 'booking' ) . // Title of TAB. | |
| 65 | - '<span class="wpbc_new_label" style="margin-left: auto;">' . esc_html__( 'New', 'booking' ) . '</span>', | |
| 68 | + 'top_path_title' => __( 'Forms Builder', 'booking' ), | |
| 69 | + 'title' => __( 'Forms Builder', 'booking' ), // Title of TAB. | |
| 66 | 70 | 'hint' => '', //__( 'Define available and unavailable days for your calendar(s).', 'booking' ), // Hint. |
| 67 | 71 | 'page_title' => __( 'Forms Builder', 'booking' ), // Title of Page. |
| 68 | 72 | 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. |
| 69 | 73 | 'position' => '', // 'left' / 'right' / ''. |
| @@ -536,22 +540,20 @@ | ||
| 536 | 540 | 'data-wpbc-bfb-top-advanced-btn' => '1', |
| 537 | 541 | ), |
| 538 | 542 | ), |
| 539 | 543 | ); |
| 540 | - if ( WPBC_BFB_DEBUG ) { | |
| 541 | - $tabs_config['debug_tab'] = array( | |
| 542 | - 'title' => __( 'Debug', 'booking' ), | |
| 543 | - 'type' => 'panel', | |
| 544 | - 'css_classes' => 'align_right small_debug_tab', | |
| 545 | - 'hint' => array( | |
| 546 | - 'title' => __( 'Show debug export outputs', 'booking' ), | |
| 547 | - 'position' => 'top', | |
| 548 | - ), | |
| 549 | - ); | |
| 550 | - } | |
| 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 | + | |
| 551 | 554 | $tabs_config = apply_filters( 'wpbc_bfb_ui__top_tabs', $tabs_config, array() ); |
| 552 | 555 | |
| 553 | - // $preferred_tab_id = ( 'On' === get_bk_option( 'booking_is_use_simple_booking_form' ) ) ? 'advanced_tab' : 'builder_tab'; | |
| 554 | 556 | $preferred_tab_id = 'builder_tab'; //TODO: make selection based on "bfb_options":{"advanced_mode_source":"builder"} |
| 555 | 557 | $active_tab_id = WPBC_BFB_UI_Top_Tabs::resolve_active_tab_id( $tabs_config, $preferred_tab_id ); |
| 556 | 558 | |
| 557 | 559 | WPBC_BFB_UI_Top_Tabs::render( |
| @@ -619,9 +621,8 @@ | ||
| 619 | 621 | ?></div><?php |
| 620 | 622 | |
| 621 | 623 | ?> |
| 622 | 624 | </div> |
| 623 | - <?php if ( WPBC_BFB_DEBUG ) { ?> | |
| 624 | 625 | <!-- Debug Mode tab --> |
| 625 | 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" |
| 626 | 627 | <?php echo WPBC_BFB_UI_Top_Tabs::get_panel_hidden_attr( 'debug_tab', $active_tab_id ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>> |
| 627 | 628 | |
| @@ -726,9 +727,8 @@ | ||
| 726 | 727 | </div> |
| 727 | 728 | |
| 728 | 729 | </div> |
| 729 | 730 | </div> |
| 730 | - <?php } ?> | |
| 731 | 731 | |
| 732 | 732 | <!-- Preview Section Content tab --> |
| 733 | 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" |
| 734 | 734 | <?php echo WPBC_BFB_UI_Top_Tabs::get_panel_hidden_attr( 'preview_tab', $active_tab_id ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>> |
| @@ -746,12 +746,12 @@ | ||
| 746 | 746 | |
| 747 | 747 | add_action( 'wpbc_menu_created', array( new WPBC_Page_Builder_Booking_Form(), '__construct' ) ); // Executed after creation of Menu. |
| 748 | 748 | |
| 749 | 749 | |
| 750 | -// == Temporary Migrate Functionality ================================================================================== | |
| 750 | +// == One-way redirect from removed legacy form settings =============================================================== | |
| 751 | 751 | |
| 752 | 752 | /** |
| 753 | - * 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. | |
| 754 | 754 | * |
| 755 | 755 | * @param bool $is_show - 'usually' - true. |
| 756 | 756 | * @param string $page_tag - can be 'wpbc-settings'. |
| 757 | 757 | * @param string $active_page_tab - can be 'form'. |
| @@ -760,9 +760,9 @@ | ||
| 760 | 760 | * @return false|mixed |
| 761 | 761 | */ |
| 762 | 762 | function wpbc_form_fields__check__showing_page( $is_show, $page_tag, $active_page_tab, $active_page_subtab ) { |
| 763 | 763 | |
| 764 | - 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 ) ) { | |
| 765 | 765 | $is_show = false; |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | return $is_show; |
| @@ -771,9 +771,9 @@ | ||
| 771 | 771 | add_filter( 'wpbc_before_showing_settings_page_is_show_page', 'wpbc_form_fields__check__showing_page', 20, 4 ); |
| 772 | 772 | |
| 773 | 773 | |
| 774 | 774 | /** |
| 775 | - * 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. | |
| 776 | 776 | * |
| 777 | 777 | * @param array $nav_tabs - array of menus. |
| 778 | 778 | * @param string $this_page - current selected page. |
| 779 | 779 | * |
| @@ -781,11 +781,9 @@ | ||
| 781 | 781 | */ |
| 782 | 782 | function wpbc_form_fields__check__plugin_menu_structure( $nav_tabs, $this_page ) { |
| 783 | 783 | |
| 784 | 784 | if ( isset( $nav_tabs['wpbc-settings'] ) && isset( $nav_tabs['wpbc-settings']['form'] ) ) { |
| 785 | - if ( WPBC_Frontend_Settings::is_bfb_enabled( null ) ) { | |
| 786 | - unset( $nav_tabs['wpbc-settings']['form'] ); | |
| 787 | - } | |
| 785 | + unset( $nav_tabs['wpbc-settings']['form'] ); | |
| 788 | 786 | } |
| 789 | 787 | |
| 790 | 788 | return $nav_tabs; |
| 791 | 789 | } |
| @@ -798,23 +796,10 @@ | ||
| 798 | 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']. |
| 799 | 797 | // Execute it only for WP Booking Calendar > Settings > Booking Form > Booking Form Fields page. |
| 800 | 798 | |
| 801 | 799 | if ( wpbc_is_settings_form_page() ) { |
| 802 | - if ( WPBC_Frontend_Settings::is_bfb_enabled( null ) ) { | |
| 803 | - // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect | |
| 804 | - wp_redirect( admin_url( "admin.php?page=wpbc-settings&tab=builder_booking_form" ) ); | |
| 805 | - // $_REQUEST['tab'] = 'builder_booking_form'; | |
| 806 | - // unset( $_REQUEST['subtab'] ); | |
| 807 | - // $_SERVER[ 'REQUEST_URI' ] = str_replace( '&subtab=form_options', '', $_SERVER[ 'REQUEST_URI' ] ); | |
| 808 | - // $_SERVER[ 'REQUEST_URI' ] = str_replace( 'tab=form', 'tab=builder_booking_form', $_SERVER[ 'REQUEST_URI' ] ); | |
| 809 | - } | |
| 810 | - } elseif ( wpbc_is_settings_bfb_page() ) { | |
| 811 | - if ( ! WPBC_Frontend_Settings::is_bfb_enabled( null ) ) { | |
| 812 | - // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect | |
| 813 | - wp_redirect( admin_url( "admin.php?page=wpbc-settings&tab=form&subtab=form_options" ) ); | |
| 814 | - // $_REQUEST['tab'] = 'form'; | |
| 815 | - // $_SERVER[ 'REQUEST_URI' ] = str_replace( 'tab=builder_booking_form', 'tab=form', $_SERVER[ 'REQUEST_URI' ] ); | |
| 816 | - } | |
| 800 | + // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect | |
| 801 | + wp_redirect( admin_url( "admin.php?page=wpbc-settings&tab=builder_booking_form" ) ); | |
| 817 | 802 | } |
| 818 | 803 | } |
| 819 | 804 | // We are set 9 to execute earlier than hook in WPBC_Admin_Menus. |
| 820 | 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 |