| @@ -914,16 +914,30 @@ | ||
| 914 | 914 | $field_options = array( |
| 915 | 915 | 'vm_booking_listing' => __('Bookings Listing' ,'booking') // FixIn: 9.6.3.5. |
| 916 | 916 | , 'vm_calendar' => __('Timeline View' ,'booking') |
| 917 | 917 | ); |
| 918 | - $this->fields['booking_listing_default_view_mode'] = array( | |
| 919 | - 'type' => 'select' | |
| 918 | + $this->fields['booking_listing_default_view_mode'] = array( | |
| 919 | + 'type' => 'select' | |
| 920 | 920 | , 'default' => $default_options_values['booking_listing_default_view_mode'] //'vm_calendar' |
| 921 | 921 | , 'title' => __('Default booking admin page', 'booking') |
| 922 | 922 | , 'description' => __('Select your default view mode of bookings at the booking listing page' ,'booking') |
| 923 | 923 | , 'options' => $field_options |
| 924 | - , 'group' => 'booking_listing' | |
| 925 | - ); | |
| 924 | + , 'group' => 'booking_listing' | |
| 925 | + ); | |
| 926 | + | |
| 927 | + if ( class_exists( 'wpdev_bk_personal' ) ) { | |
| 928 | + $this->fields['booking_admin_edit_booking_mode'] = array( | |
| 929 | + 'type' => 'select', | |
| 930 | + 'default' => $default_options_values['booking_admin_edit_booking_mode'], | |
| 931 | + 'title' => __( 'Edit booking in', 'booking' ), | |
| 932 | + 'description' => __( 'Choose whether Edit booking opens in a popup or on the dedicated Add Booking page.', 'booking' ), | |
| 933 | + 'options' => array( | |
| 934 | + 'popup' => __( 'Popup window (default)', 'booking' ), | |
| 935 | + 'add_booking_page' => __( 'Add Booking page', 'booking' ), | |
| 936 | + ), | |
| 937 | + 'group' => 'booking_listing', | |
| 938 | + ); | |
| 939 | + } | |
| 926 | 940 | |
| 927 | 941 | // Default booking resources. |
| 928 | 942 | $this->fields = apply_filters( 'wpbc_settings_booking_listing_br_default_count', $this->fields, $default_options_values ); |
| 929 | 943 | |
| @@ -1178,9 +1192,9 @@ | ||
| 1178 | 1192 | // <editor-fold defaultstate="collapsed" desc=" Advanced " > |
| 1179 | 1193 | |
| 1180 | 1194 | if ( wpbc_is_11_6_features_enabled() && wpbc_booking_resources_catalog_can_manage_settings() ) { |
| 1181 | 1195 | $is_pro_compatible = wpbc_booking_resources_catalog_is_pro_compatible(); |
| 1182 | - $description = __( 'Legacy catalog pages are deprecated and scheduled for removal in Booking Calendar 11.7. This setting applies to all administration catalogs upgraded in Booking Calendar 11.6.', 'booking' ); | |
| 1196 | + $description = __( 'Choose the new or legacy pages for upgraded administration catalogs, including Seasonal Availability and Searchable Resources when their new catalogs are enabled. Legacy pages remain available for compatibility.', 'booking' ); | |
| 1183 | 1197 | |
| 1184 | 1198 | if ( ! $is_pro_compatible ) { |
| 1185 | 1199 | $pro_version = wpbc_booking_resources_catalog_get_pro_version(); |
| 1186 | 1200 | if ( '' === $pro_version ) { |
| @@ -1187,9 +1201,9 @@ | ||
| 1187 | 1201 | $pro_version = __( 'Unknown', 'booking' ); |
| 1188 | 1202 | } |
| 1189 | 1203 | |
| 1190 | 1204 | /* translators: 1: Detected Booking Calendar Pro version, 2: Minimum compatible Pro version. */ |
| 1191 | - $description = sprintf( __( 'Legacy catalog mode is required because Booking Calendar Pro %1$s is active. Update Pro to %2$s or newer to use the new catalogs. Legacy catalog pages are deprecated and scheduled for removal in Booking Calendar 11.7.', 'booking' ), esc_html( $pro_version ), esc_html( wpbc_booking_resources_catalog_get_minimum_pro_version() ) ); | |
| 1205 | + $description = sprintf( __( 'Legacy catalog mode is required because Booking Calendar Pro %1$s is active. Update Pro to %2$s or newer to use the new catalogs. Legacy pages remain available for compatibility.', 'booking' ), esc_html( $pro_version ), esc_html( wpbc_booking_resources_catalog_get_minimum_pro_version() ) ); | |
| 1192 | 1206 | } |
| 1193 | 1207 | |
| 1194 | 1208 | $this->fields['booking_resources_catalog_renderer'] = array( |
| 1195 | 1209 | 'type' => 'select', |
| @@ -2032,8 +2046,30 @@ | ||
| 2032 | 2046 | return $stored_renderer; |
| 2033 | 2047 | } |
| 2034 | 2048 | |
| 2035 | 2049 | return $submitted_renderer; |
| 2050 | + } | |
| 2051 | + | |
| 2052 | + /** | |
| 2053 | + * Validate the administrator edit-booking destination. | |
| 2054 | + * | |
| 2055 | + * The General Settings page owns nonce and capability checks. This method | |
| 2056 | + * adds an explicit allow list and preserves the current normalized setting | |
| 2057 | + * when a malformed value is submitted. | |
| 2058 | + * | |
| 2059 | + * @param string $post_key Full Settings API POST key. | |
| 2060 | + * | |
| 2061 | + * @return string Allow-listed edit destination. | |
| 2062 | + */ | |
| 2063 | + public function validate_booking_admin_edit_booking_mode_post( $post_key ) { | |
| 2064 | + $stored_mode = wpbc_get_booking_admin_edit_mode(); | |
| 2065 | + $submitted_mode = self::validate_select_post_static( $post_key ); | |
| 2066 | + | |
| 2067 | + if ( ! is_string( $submitted_mode ) || ! in_array( $submitted_mode, array( 'popup', 'add_booking_page' ), true ) ) { | |
| 2068 | + return $stored_mode; | |
| 2069 | + } | |
| 2070 | + | |
| 2071 | + return $submitted_mode; | |
| 2036 | 2072 | } |
| 2037 | 2073 | |
| 2038 | 2074 | } |
| 2039 | 2075 | |