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 | includes/ui_settings/class-page-structure.php +41 -28 11.5 → 11.9 View file →
@@ -21,13 +21,15 @@
21 21 * == All Page Parameters ==
22 22 *
23 23 * TODO Refactorig: Continue work with description of the: List of all parameters, that possible to use in public function tabs() { ... }
24 24
25 -'is_default_full_screen' => false, // true | false. Default: false.
26 -'is_force_full_screen' => false, // true | false. Default: false.
25 +'is_default_full_screen' => false, // true | false. Default: false.
26 +'is_force_full_screen' => false, // true | false. Default: false.
27 +'is_force_normal_screen' => false, // true | false. Default: false.
27 28 'right_vertical_sidebar__is_show' => false, // true | false. Default: false.
28 -'right_vertical_sidebar__default_view_mode' => 'max', // '' | 'min' | 'compact' | 'max' | 'none'. Default: ''.
29 -'left_navigation__default_view_mode' => 'max', // '' | 'min' | 'compact' | 'max' | 'none'. Default: ''.
29 +'right_vertical_sidebar__default_view_mode' => 'max', // '' | 'min' | 'compact' | 'max' | 'none'. Default: ''.
30 +'right_vertical_sidebar__content_click_collapse_mode' => '', // '' | 'min' | 'compact' | 'none'. Collapse or hide an expanded right sidebar when the page content is clicked. Default: ''.
31 +'left_navigation__default_view_mode' => 'max', // '' | 'min' | 'compact' | 'max' | 'none'. Default: ''.
30 32 'left_navigation__force_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. Default: ''.
31 33 'right_vertical_sidebar_compact__is_show' => false, // true | false. Default: false.
32 34
33 35 // TODO: recheck functionality and ability to use:
@@ -457,21 +459,27 @@
457 459
458 460 return $page_default_mode;
459 461 }
460 462
461 - /**
462 - * Check whether the current page should open in fullscreen.
463 + /**
464 + * Check whether the current page should open in fullscreen.
465 + *
466 + * Forced normal mode wins first, followed by forced fullscreen, the saved user
467 + * preference, and finally the page default. This order lets passive pages leave
468 + * fullscreen without changing the administrator's preference for other pages.
463 469 *
464 - * Forced page mode wins, then the saved user preference, then the page default.
465 - *
466 470 * @return bool
467 471 */
468 - public function is_full_screen_mode_enabled() {
472 + public function is_full_screen_mode_enabled() {
473 +
474 + if ( $this->is_use_option__in_subtabs_or_tabs( 'is_force_normal_screen' ) ) {
475 + return false;
476 + }
477 +
478 + if ( $this->is_use_option__in_subtabs_or_tabs( 'is_force_full_screen' ) ) {
479 + return true;
480 + }
469 481
470 - if ( $this->is_use_option__in_subtabs_or_tabs( 'is_force_full_screen' ) ) {
471 - return true;
472 - }
473 -
474 482 if ( class_exists( 'WPBC_User_Custom_Data_Saver' ) ) {
475 483 $saved_full_screen = WPBC_User_Custom_Data_Saver::get_user_data_value( wpbc_get_current_user_id(), 'is_full_screen' );
476 484 $saved_full_screen = function_exists( 'wpbc_ui__get_full_screen_mode_from_cookie' )
477 485 ? wpbc_ui__get_full_screen_mode_from_cookie( $saved_full_screen )
@@ -488,19 +496,25 @@
488 496
489 497 return (bool) $this->is_use_option__in_subtabs_or_tabs( 'is_default_full_screen' );
490 498 }
491 499
492 - /**
493 - * Check whether the current page should save and restore the user fullscreen preference.
494 - *
495 - * @return bool
496 - */
497 - public function is_full_screen_user_mode_enabled() {
500 + /**
501 + * Check whether the current page should save and restore the user fullscreen preference.
502 + *
503 + * Pages with either forced display mode are page-controlled and must not mutate
504 + * the administrator's reusable fullscreen preference.
505 + *
506 + * @return bool
507 + */
508 + public function is_full_screen_user_mode_enabled() {
509 +
510 + if (
511 + $this->is_use_option__in_subtabs_or_tabs( 'is_force_normal_screen' )
512 + || $this->is_use_option__in_subtabs_or_tabs( 'is_force_full_screen' )
513 + ) {
514 + return false;
515 + }
498 516
499 - if ( $this->is_use_option__in_subtabs_or_tabs( 'is_force_full_screen' ) ) {
500 - return false;
501 - }
502 -
503 517 return true;
504 518 }
505 519
506 520 /**
@@ -626,18 +640,17 @@
626 640 * @return string
627 641 */
628 642 private function get_top_path_default_root_title( $page_tag ) {
629 643
630 - $root_titles = array(
644 + $root_titles = array(
631 645 'wpbc' => __( 'Bookings', 'booking' ),
632 646 'wpbc-availability' => __( 'Availability', 'booking' ),
633 647 'wpbc-prices' => __( 'Prices', 'booking' ),
634 648 'wpbc-resources' => __( 'Resources', 'booking' ),
635 649 'wpbc-settings' => __( 'Settings', 'booking' ),
636 - 'wpbc-setup' => __( 'Setup', 'booking' ),
637 - );
638 -
639 - return isset( $root_titles[ $page_tag ] ) ? $root_titles[ $page_tag ] : __( 'Booking Calendar', 'booking' );
650 + 'wpbc-setup' => __( 'Setup', 'booking' ),
651 + );
652 + return isset( $root_titles[ $page_tag ] ) ? $root_titles[ $page_tag ] : __( 'Booking Calendar', 'booking' );
640 653 }
641 654
642 655 /**
643 656 * Get product root URL.