← All changes
|
includes/page-settings-calendar/settings_calendar__page.php
+18
-10
11.7
→
11.9
View file →
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Calendar settings page. |
| 4 | 4 | * |
| @@ -809,18 +809,26 @@ | ||
| 809 | 809 | * @param array $request_params Calendar-load request params. |
| 810 | 810 | * |
| 811 | 811 | * @return bool |
| 812 | 812 | */ |
| 813 | -function wpbc_settings_calendar__is_calendar_load_preview_request_allowed( $request_params ) { | |
| 813 | +function wpbc_settings_calendar__is_calendar_load_preview_request_allowed( $request_params ) { | |
| 814 | + | |
| 815 | + $is_settings_preview_allowed = ( | |
| 816 | + ! empty( $request_params['wpbc_settings_calendar_preview'] ) | |
| 817 | + && function_exists( 'wpbc_is_mu_user_can_be_here' ) | |
| 818 | + && wpbc_is_mu_user_can_be_here( 'only_super_admin' ) | |
| 819 | + && current_user_can( wpbc_settings_calendar__get_manage_cap() ) | |
| 820 | + ); | |
| 821 | + if ( $is_settings_preview_allowed ) { | |
| 822 | + return true; | |
| 823 | + } | |
| 824 | + | |
| 825 | + return ( | |
| 826 | + class_exists( 'WPBC_Setup_Wizard_Date_Selection' ) | |
| 827 | + && WPBC_Setup_Wizard_Date_Selection::is_calendar_preview_request_allowed( (array) $request_params ) | |
| 828 | + ); | |
| 829 | +} | |
| 814 | 830 | |
| 815 | - return ( | |
| 816 | - ! empty( $request_params['wpbc_settings_calendar_preview'] ) | |
| 817 | - && function_exists( 'wpbc_is_mu_user_can_be_here' ) | |
| 818 | - && wpbc_is_mu_user_can_be_here( 'only_super_admin' ) | |
| 819 | - && current_user_can( wpbc_settings_calendar__get_manage_cap() ) | |
| 820 | - ); | |
| 821 | -} | |
| 822 | - | |
| 823 | 831 | /** |
| 824 | 832 | * Get option overrides from Calendar Settings calendar-load AJAX request. |
| 825 | 833 | * |
| 826 | 834 | * @param array $request_params Calendar-load request params. |
| @@ -1627,9 +1635,9 @@ | ||
| 1627 | 1635 | 'is_show_top_path' => true, |
| 1628 | 1636 | 'right_vertical_sidebar__is_show' => true, |
| 1629 | 1637 | 'right_vertical_sidebar__default_view_mode' => '', |
| 1630 | 1638 | 'right_vertical_sidebar_compact__is_show' => true, |
| 1631 | - 'left_navigation__default_view_mode' => 'compact', | |
| 1639 | + 'left_navigation__default_view_mode' => '', // FixIn:11.7.1.1: 'compact', | |
| 1632 | 1640 | 'top_path_title' => __( 'Calendar', 'booking' ), |
| 1633 | 1641 | 'title' => __( 'Calendar', 'booking' ), // . '<span class="wpbc_new_label" style="margin-left: auto;">' . esc_html__( 'New', 'booking' ) . '</span> ', |
| 1634 | 1642 | 'hint' => __( 'Preview and configure date selection, range selection, and change-over behavior.', 'booking' ), |
| 1635 | 1643 | 'page_title' => __( 'Calendar Settings', 'booking' ), |