| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @version 1.0 |
| 4 | 4 | * @package General Settings API - Saving different options |
| @@ -14,10 +14,10 @@ | ||
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | // General Settings API - Saving different options |
| 17 | 17 | class WPBC_Settings_API_General extends WPBC_Settings_API { |
| 18 | - | |
| 19 | 18 | |
| 19 | + | |
| 20 | 20 | /** |
| 21 | 21 | * Override Settings API Constructor |
| 22 | 22 | * During creation, system try to load values from DB, if exist. |
| 23 | 23 | * |
| @@ -48,30 +48,9 @@ | ||
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | // <editor-fold defaultstate="collapsed" desc=" C a l e n d a r S e c t i o n " > |
| 51 | 51 | |
| 52 | - $this->fields['booking_skin'] = array( | |
| 53 | - 'type' => 'select' | |
| 54 | - , 'default' => $default_options_values['booking_skin'] // '/css/skins/traditional.css' // Activation|Deactivation of this options in wpbc-activation file. // Default value in wpbc_get_default_options('booking_skin') | |
| 55 | - //, 'value' => '/css/skins/standard.css' //This will override value loaded from DB | |
| 56 | - , 'title' => __('Calendar Skin', 'booking') | |
| 57 | - , 'description' => __('Select the skin of the booking calendar' ,'booking') | |
| 58 | - , 'options' => wpbc_get_calendar_skin_options() | |
| 59 | - , 'group' => 'calendar' | |
| 60 | - ); | |
| 61 | 52 | |
| 62 | -// //Show | Hide links for Advanced JavaScript section | |
| 63 | -// $this->fields['booking_skin_help'] = array( | |
| 64 | -// 'type' => 'html' | |
| 65 | -// , 'html' => | |
| 66 | -// '<div class="wpbc-settings-notice notice-info" style="text-align:left;">' | |
| 67 | -// . '<strong>' . esc_html__('Note!' ,'booking') . '</strong> ' | |
| 68 | -// . sprintf( __( 'If you have customized your own calendar skin, please save it to: %s Its will save your custom skin during future updates of plugin.', 'booking' ), '<code>/wp-content/uploads/wpbc_skins/</code><br/>' ) | |
| 69 | -// . '</div>' | |
| 70 | -// , 'cols' => 2 | |
| 71 | -// , 'group' => 'calendar' | |
| 72 | -// ); | |
| 73 | - | |
| 74 | 53 | // Number of months ////////////////////////////////////////////////// |
| 75 | 54 | $months_options = array(); |
| 76 | 55 | for ($mm = 1; $mm < 12; $mm++) { $months_options[ $mm . 'm' ] = $mm . ' ' . __('month(s)' ,'booking'); } |
| 77 | 56 | $months_options[ 18 . 'm' ] = '18 ' . __('month(s)' ,'booking'); // FixIn: 10.0.0.11. |
| @@ -104,9 +83,19 @@ | ||
| 104 | 83 | , '6' => __('Saturday' ,'booking') |
| 105 | 84 | ) |
| 106 | 85 | , 'group' => 'calendar' |
| 107 | 86 | ); |
| 108 | - | |
| 87 | + | |
| 88 | + $this->fields['booking_calendar_allow_several_months_on_mobile'] = array( | |
| 89 | + 'type' => 'checkbox' | |
| 90 | + , 'default' => $default_options_values['booking_calendar_allow_several_months_on_mobile'] //'Off' | |
| 91 | + , 'title' => __('Allow multiple months to be shown on mobile' ,'booking') //__('Use time selections as recurrent time slots' ,'booking') | |
| 92 | + , 'label' => __('Enable this option to allow multiple months to be shown in the calendar on mobile devices. By default, the calendar only shows one month on mobile devices for easy scrolling.' ,'booking') | |
| 93 | + //, 'description' => '' | |
| 94 | + , 'group' => 'calendar' | |
| 95 | + , 'tr_class' => '' | |
| 96 | + ); | |
| 97 | + | |
| 109 | 98 | // Divider /////////////////////////////////////////////////////////// |
| 110 | 99 | $this->fields['hr_calendar_after_week_day'] = array( 'type' => 'hr', 'group' => 'calendar' ); |
| 111 | 100 | |
| 112 | 101 | |
| @@ -156,17 +145,8 @@ | ||
| 156 | 145 | ); |
| 157 | 146 | |
| 158 | 147 | $this->fields = apply_filters( 'wpbc_settings_calendar_check_in_out_times', $this->fields, $default_options_values ); // Check In/Out Times |
| 159 | 148 | |
| 160 | - $this->fields['booking_calendar_allow_several_months_on_mobile'] = array( | |
| 161 | - 'type' => 'checkbox' | |
| 162 | - , 'default' => $default_options_values['booking_calendar_allow_several_months_on_mobile'] //'Off' | |
| 163 | - , 'title' => __('Allow multiple months to be shown on mobile' ,'booking') //__('Use time selections as recurrent time slots' ,'booking') | |
| 164 | - , 'label' => __('Enable this option to allow multiple months to be shown in the calendar on mobile devices. By default, the calendar only shows one month on mobile devices for easy scrolling.' ,'booking') | |
| 165 | - //, 'description' => '' | |
| 166 | - , 'group' => 'calendar' | |
| 167 | - , 'tr_class' => 'wpbc_recurrent_check_in_out_time_slots' | |
| 168 | - ); | |
| 169 | 149 | |
| 170 | 150 | // </editor-fold> |
| 171 | 151 | |
| 172 | 152 | |
| @@ -451,85 +431,8 @@ | ||
| 451 | 431 | ); |
| 452 | 432 | // </editor-fold> |
| 453 | 433 | |
| 454 | 434 | |
| 455 | - | |
| 456 | - // <editor-fold defaultstate="collapsed" desc=" T i m e S l o t s " > | |
| 457 | - | |
| 458 | - $my_close_open_alert_id = 'bk_alert_booking_timeslot_picker__help_tip'; | |
| 459 | - $this->fields['booking_timeslot_picker__help_tip'] = array( | |
| 460 | - 'type' => 'pure_html' | |
| 461 | - , 'group' => 'time_slots' | |
| 462 | - , 'html' => '<tr><td colspan="2">' | |
| 463 | - .'<div class="wpbc-general-settings-notice wpbc-settings-notice notice-info">' | |
| 464 | - . '<strong class="alert-heading">' . esc_html__( 'Note', 'booking' ) . '!</strong> ' | |
| 465 | - /* translators: 1: ... */ | |
| 466 | - . sprintf( __( 'You can enable or disable, as well as configure %1$sTime Slots%2$s for your booking form on the Settings > %3$sBooking Form%4$s page.', 'booking' ), | |
| 467 | - '<strong>', '</strong>', | |
| 468 | - '<strong><a href="' . esc_url( wpbc_get_settings_url( true, false ) . '&tab=form' ) . '">', '</a></strong>' | |
| 469 | - ) | |
| 470 | - . '</div>' | |
| 471 | - | |
| 472 | - .'</td> </tr>' | |
| 473 | - ); | |
| 474 | - | |
| 475 | - | |
| 476 | - // FixIn: 8.7.11.10. | |
| 477 | - $this->fields['booking_timeslot_picker'] = array( | |
| 478 | - 'type' => 'checkbox' | |
| 479 | - , 'default' => $default_options_values['booking_timeslot_picker'] //'Off' | |
| 480 | - , 'title' => __('Time picker for time slots' ,'booking') | |
| 481 | - , 'label' => __('Show time slots as a time picker instead of a select box.' ,'booking') | |
| 482 | - , 'description' => '' | |
| 483 | - | |
| 484 | - , 'group' => 'time_slots' | |
| 485 | - , 'tr_class' => 'wpbc_timeslot_picker' | |
| 486 | - ); | |
| 487 | - | |
| 488 | - // Time Picker Skin ///////////////////////////////////////////////////// | |
| 489 | - $timeslot_picker_skins_options = array(); | |
| 490 | - | |
| 491 | - // Skins in the Custom User folder (need to create it manually): http://example.com/wp-content/uploads/wpbc_skins/ ( This folder do not owerwrited during update of plugin ) | |
| 492 | - $upload_dir = wp_upload_dir(); | |
| 493 | - // FixIn: 8.9.4.8. | |
| 494 | - $files_in_folder = wpbc_dir_list( array( WPBC_PLUGIN_DIR . '/css/time_picker_skins/', $upload_dir['basedir'].'/wpbc_time_picker_skins/' ) ); // Folders where to look about Time Picker skins | |
| 495 | - | |
| 496 | - foreach ( $files_in_folder as $skin_file ) { // Example: $skin_file['/css/skins/standard.css'] => 'Standard'; | |
| 497 | - //FixIn: 8.9.4.8 // FixIn: 9.1.2.10. | |
| 498 | - $skin_file[1] = str_replace( array( WPBC_PLUGIN_DIR, WPBC_PLUGIN_URL, $upload_dir['basedir'] ), '', $skin_file[1] ); // Get relative path for Time Picker skin | |
| 499 | - $timeslot_picker_skins_options[ $skin_file[1] ] = $skin_file[2]; | |
| 500 | - } | |
| 501 | - | |
| 502 | - $this->fields['booking_timeslot_picker_skin'] = array( | |
| 503 | - 'type' => 'select' | |
| 504 | - , 'default' => $default_options_values['booking_timeslot_picker_skin'] // '/css/skins/traditional.css' // Activation|Deactivation of this options in wpbc-activation file. // Default value in wpbc_get_default_options('booking_skin') | |
| 505 | - //, 'value' => '/css/time_picker_skins/grey.css' //This will override value loaded from DB | |
| 506 | - , 'title' => __('Time Picker Skin', 'booking') | |
| 507 | - , 'description' => __('Select the skin of the time picker' ,'booking') | |
| 508 | - , 'options' => $timeslot_picker_skins_options | |
| 509 | - , 'group' => 'time_slots' | |
| 510 | - ); | |
| 511 | - | |
| 512 | - | |
| 513 | - | |
| 514 | - // FixIn: 8.2.1.27. | |
| 515 | - $this->fields['booking_timeslot_day_bg_as_available'] = array( | |
| 516 | - 'type' => 'checkbox' | |
| 517 | - , 'default' => $default_options_values['booking_timeslot_day_bg_as_available'] //'Off' | |
| 518 | - , 'title' => __('Do not change background color for partially booked days' ,'booking') | |
| 519 | - , 'label' => __('Show partially booked days with same background as in legend item' ,'booking') | |
| 520 | - , 'description' => '<span class="description0" style="line-height: 1.7em;margin: 0 0 0 -10px;"><strong>' . esc_html__('Note' ,'booking') .':</strong> ' | |
| 521 | - . sprintf(__('Partially booked item - day, which is booked for the specific time-slot(s).' ,'booking'),'<b>','</b>') | |
| 522 | - . '</span>' | |
| 523 | - | |
| 524 | - , 'group' => 'time_slots' | |
| 525 | - , 'tr_class' => 'wpbc_timeslot_day_bg_as_available' | |
| 526 | - ); | |
| 527 | - | |
| 528 | - | |
| 529 | - // </editor-fold> | |
| 530 | - | |
| 531 | - | |
| 532 | 435 | // <editor-fold defaultstate="collapsed" desc=" A v a i l a b i l i t y " > |
| 533 | 436 | |
| 534 | 437 | // Unavailable Weekdays ///////////////////////////////////////////// |
| 535 | 438 | |
| @@ -621,131 +524,32 @@ | ||
| 621 | 524 | ); |
| 622 | 525 | |
| 623 | 526 | // Limit available days from today /////////////////////////////////// |
| 624 | 527 | $this->fields = apply_filters( 'wpbc_settings_calendar_unavailable_days', $this->fields, $default_options_values ); |
| 625 | - | |
| 626 | 528 | |
| 529 | + $this->fields['booking_unavailable_days_num_from_today__warning'] = array( | |
| 530 | + 'type' => 'html', | |
| 531 | + 'html' => '<div class="wpbc-settings-notice notice-warning notice-helpful-info">' . | |
| 532 | + '<strong>' . esc_html__('Note' ,'booking') . '!</strong> ' . | |
| 533 | + __( 'These options do not apply in the admin panel. These options apply only on the front-end side.', 'booking' ) . | |
| 534 | + '</div>', | |
| 535 | + 'class' => '', | |
| 536 | + 'css' => 'margin:0;padding:0;border:0;', | |
| 537 | + 'description' => '', | |
| 538 | + 'cols' => 1, | |
| 539 | + 'group' => 'availability', | |
| 540 | + 'tr_class' => '', | |
| 541 | + 'description_tag' => 'div', | |
| 542 | + ); | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 627 | 546 | // Extend unavailable booking dates interval - cleaning ////////////// |
| 628 | 547 | $this->fields = apply_filters( 'wpbc_settings_calendar_extend_unavailable_interval', $this->fields, $default_options_values ); |
| 629 | 548 | |
| 630 | 549 | // </editor-fold> |
| 631 | - | |
| 632 | - | |
| 633 | - // <editor-fold defaultstate="collapsed" desc=" F o r m S e c t i o n " > | |
| 634 | 550 | |
| 635 | 551 | |
| 636 | - // Start Day of the week ///////////////////////////////////////////// | |
| 637 | - /* | |
| 638 | - if ( ! class_exists('wpdev_bk_personal') ) | |
| 639 | - $this->fields['booking_form_structure_type'] = array( | |
| 640 | - 'type' => 'select' | |
| 641 | - , 'default' => $default_options_values['booking_form_structure_type'] // '2' | |
| 642 | - // , 'value' => false | |
| 643 | - , 'title' => __('Booking form structure', 'booking') | |
| 644 | - , 'description' => __('Select how to show your booking form.' ,'booking') | |
| 645 | - , 'description_tag' => 'p' | |
| 646 | - , 'options' => array( | |
| 647 | - 'vertical' => __('Form under calendar' ,'booking') | |
| 648 | - , 'form_right' => __('Form at right side of calendar' ,'booking') | |
| 649 | - ) | |
| 650 | - , 'group' => 'form' | |
| 651 | - ); | |
| 652 | - */ | |
| 653 | - $this->fields['booking_form_theme'] = array( | |
| 654 | - 'type' => 'select' | |
| 655 | - , 'default' => $default_options_values['booking_form_theme'] //'Off' | |
| 656 | - , 'title' => __('Color Theme' ,'booking') | |
| 657 | - , 'description' => __('Select a color theme for your booking form that matches the look of your website.' ,'booking') //. ' <sup style="color:#7812bd;"><strong>βeta '.__('feature','booking').'</strong></sup>' | |
| 658 | - . '<div class="wpbc-general-settings-notice wpbc-settings-notice notice-info">' | |
| 659 | - . __('When you select a color theme, it also change the calendar and time-slot picker skins to match your choice. Customize these options separately as needed.' ,'booking') | |
| 660 | - .'</div>' | |
| 661 | - | |
| 662 | - , 'options' => array( | |
| 663 | - '' => __( 'Light', 'booking' ), | |
| 664 | - 'wpbc_theme_dark_1' => __( 'Dark', 'booking' ) | |
| 665 | - ) | |
| 666 | - , 'group' => 'form' | |
| 667 | - ); | |
| 668 | - | |
| 669 | - $this->fields['booking_is_use_captcha'] = array( | |
| 670 | - 'type' => 'checkbox' | |
| 671 | - , 'default' => $default_options_values['booking_is_use_captcha'] //'Off' | |
| 672 | - , 'title' => __('CAPTCHA' ,'booking') | |
| 673 | - , 'label' => __('Check the box to activate CAPTCHA inside the booking form.' ,'booking') | |
| 674 | - , 'description' => '<div class="wpbc-general-settings-notice wpbc-settings-notice notice-warning" style="margin-top:-10px;">' | |
| 675 | - . '<strong>' . esc_html__('Note' ,'booking') . '!</strong> ' . | |
| 676 | - __( 'If your website uses a cache plugin or system, exclude pages with booking forms from caching to ensure CAPTCHA functions correctly.', 'booking' ) | |
| 677 | - .'</div>' | |
| 678 | - , 'group' => 'form' | |
| 679 | - ); | |
| 680 | - $this->fields['booking_is_use_autofill_4_logged_user'] = array( | |
| 681 | - 'type' => 'checkbox' | |
| 682 | - , 'default' => $default_options_values['booking_is_use_autofill_4_logged_user'] // 'Off' | |
| 683 | - , 'title' => __('Auto-fill fields' ,'booking') | |
| 684 | - , 'label' => __('Check the box to activate auto-fill form fields for logged in users.' ,'booking') | |
| 685 | - , 'description' => '' | |
| 686 | - , 'group' => 'form' | |
| 687 | - ); | |
| 688 | - | |
| 689 | - $this->fields['hr_calendar_after_autofill'] = array( 'type' => 'hr', 'group' => 'form' ); | |
| 690 | - | |
| 691 | - if ( class_exists( 'wpdev_bk_personal' ) ) // FixIn: 8.1.1.12. | |
| 692 | - $this->fields['booking_is_use_simple_booking_form'] = array( | |
| 693 | - 'type' => 'checkbox' | |
| 694 | - , 'default' => $default_options_values['booking_is_use_simple_booking_form'] //'Off' | |
| 695 | - , 'title' => __('Simple' ,'booking') . ' ' . __('Booking Form', 'booking') | |
| 696 | - , 'label' => __('Check the box, if you want to use simple booking form customization from Free plugin version at Settings - Form page.' ,'booking') | |
| 697 | - , 'description' => '' | |
| 698 | - , 'group' => 'form' | |
| 699 | - ); | |
| 700 | - if ( class_exists( 'wpdev_bk_personal' ) ) // FixIn: 8.1.1.12. | |
| 701 | - $this->fields['booking_is_use_codehighlighter_booking_form'] = array( | |
| 702 | - 'type' => 'checkbox' | |
| 703 | - , 'default' => $default_options_values['booking_is_use_codehighlighter_booking_form'] //'Off' | |
| 704 | - , 'title' => __('Syntax highlighter' ,'booking') | |
| 705 | - , 'label' => __('Check the box, if you want to use syntax highlighter during customization booking form.' ,'booking') | |
| 706 | - , 'description' => '' | |
| 707 | - , 'group' => 'form' | |
| 708 | - ); | |
| 709 | - | |
| 710 | - | |
| 711 | - // FixIn: 10.0.0.31. | |
| 712 | - if ( class_exists( 'wpdev_bk_biz_m' ) ){ | |
| 713 | - $this->fields['booking_number_for_pre_checkin_date_hint'] = array( | |
| 714 | - 'type' => 'select' | |
| 715 | - , 'default' => $default_options_values['booking_number_for_pre_checkin_date_hint'] //'0' | |
| 716 | - , 'title' => __( 'Pre-Check-in Display Duration', 'booking' ) | |
| 717 | - /* translators: 1: ... */ | |
| 718 | - , 'description' => sprintf( __( 'Select the number of days for the %s shortcode.', 'booking' ), '<strong>[pre_checkin_date_hint]</strong>' ) | |
| 719 | - . ' ' | |
| 720 | - /* translators: 1: ... */ | |
| 721 | - . sprintf( __( 'This shortcode is used in the booking form to display the date %1$sN days before%2$s the selected check-in date.', 'booking' ) | |
| 722 | - , '<a href="'. esc_url( wpbc_get_settings_url() ) . '&tab=form">', '</a>' ) | |
| 723 | - //, '<a href="'.wpbc_get_settings_url( true, false ) . '&scroll_to_section=wpbc_general_settings_form_tab">', '</a>' ) | |
| 724 | - , 'options' => array_combine( range( 1, 91 ), range( 1, 91 ) ) | |
| 725 | - , 'group' => 'form' | |
| 726 | - ); | |
| 727 | - } | |
| 728 | -// if ( class_exists( 'wpdev_bk_personal' ) ){ // FixIn: 8.8.1.14. | |
| 729 | -// | |
| 730 | -// $this->fields['booking_send_button_title'] = array( | |
| 731 | -// 'type' => 'text' | |
| 732 | -// , 'default' => $default_options_values['booking_send_button_title'] // 'Send' | |
| 733 | -// , 'placeholder' => __( 'Send', 'booking' ) | |
| 734 | -// , 'title' => __( 'Title of send button' ,'booking' ) | |
| 735 | -// , 'description' => sprintf( __( 'Enter %1$stitle of submit button%2$s in the booking form', 'booking' ),'<b>','</b>') | |
| 736 | -// , 'description_tag' => 'p' | |
| 737 | -// , 'css' => 'width:100%' | |
| 738 | -// , 'group' => 'form' | |
| 739 | -// , 'tr_class' => 'wpbc_send_button_title' | |
| 740 | -// ); | |
| 741 | -// } | |
| 742 | - | |
| 743 | - | |
| 744 | - // </editor-fold> | |
| 745 | - | |
| 746 | - | |
| 747 | - | |
| 748 | 552 | // <editor-fold defaultstate="collapsed" desc=" B o o k i n g C o n f i r m a t i o n " > |
| 749 | 553 | |
| 750 | 554 | $field_options = array( |
| 751 | 555 | 'message' => array( 'title' => __('Show booking confirmation at same page' ,'booking'), 'attr' => array( 'id' => 'type_of_thank_you_message_message' ) ) |
| @@ -1110,32 +914,32 @@ | ||
| 1110 | 914 | $field_options = array( |
| 1111 | 915 | 'vm_booking_listing' => __('Bookings Listing' ,'booking') // FixIn: 9.6.3.5. |
| 1112 | 916 | , 'vm_calendar' => __('Timeline View' ,'booking') |
| 1113 | 917 | ); |
| 1114 | - $this->fields['booking_listing_default_view_mode'] = array( | |
| 1115 | - 'type' => 'select' | |
| 918 | + $this->fields['booking_listing_default_view_mode'] = array( | |
| 919 | + 'type' => 'select' | |
| 1116 | 920 | , 'default' => $default_options_values['booking_listing_default_view_mode'] //'vm_calendar' |
| 1117 | 921 | , 'title' => __('Default booking admin page', 'booking') |
| 1118 | 922 | , 'description' => __('Select your default view mode of bookings at the booking listing page' ,'booking') |
| 1119 | 923 | , 'options' => $field_options |
| 1120 | - , 'group' => 'booking_listing' | |
| 1121 | - ); | |
| 1122 | -// // FixIn: 9.5.5.7. | |
| 1123 | -// $this->fields['booking_admin_panel_skin'] = array( | |
| 1124 | -// 'type' => 'select' | |
| 1125 | -// , 'default' => $default_options_values['booking_admin_panel_skin'] // 'modern_1' | |
| 1126 | -// , 'title' => __('Theme of booking admin panel', 'booking') | |
| 1127 | -// , 'description' => __('Select theme of your booking admin panel' ,'booking') | |
| 1128 | -// , 'options' => array( | |
| 1129 | -// 'modern_1' => __( 'Modern Theme', 'booking' ) | |
| 1130 | -// , 'legacy' => __( 'Legacy Theme', 'booking' ) | |
| 1131 | -// ) | |
| 1132 | -// , 'group' => 'booking_listing' | |
| 1133 | -// ); | |
| 1134 | -// | |
| 1135 | -// // FixIn: 9.6.3.5. | |
| 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 | + } | |
| 1136 | 940 | |
| 1137 | - //Default booking resources | |
| 941 | + // Default booking resources. | |
| 1138 | 942 | $this->fields = apply_filters( 'wpbc_settings_booking_listing_br_default_count', $this->fields, $default_options_values ); |
| 1139 | 943 | |
| 1140 | 944 | |
| 1141 | 945 | // FixIn: 8.6.1.13. |
| @@ -1384,111 +1188,49 @@ | ||
| 1384 | 1188 | // auto_cancelation_approval |
| 1385 | 1189 | $this->fields = apply_filters( 'wpbc_settings_auto_cancelation_approval_section', $this->fields, $default_options_values ); |
| 1386 | 1190 | // </editor-fold> |
| 1387 | 1191 | |
| 1192 | + // <editor-fold defaultstate="collapsed" desc=" Advanced " > | |
| 1193 | + | |
| 1194 | + if ( wpbc_is_11_6_features_enabled() && wpbc_booking_resources_catalog_can_manage_settings() ) { | |
| 1195 | + $is_pro_compatible = wpbc_booking_resources_catalog_is_pro_compatible(); | |
| 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' ); | |
| 1197 | + | |
| 1198 | + if ( ! $is_pro_compatible ) { | |
| 1199 | + $pro_version = wpbc_booking_resources_catalog_get_pro_version(); | |
| 1200 | + if ( '' === $pro_version ) { | |
| 1201 | + $pro_version = __( 'Unknown', 'booking' ); | |
| 1202 | + } | |
| 1203 | + | |
| 1204 | + /* translators: 1: Detected Booking Calendar Pro version, 2: Minimum compatible 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() ) ); | |
| 1206 | + } | |
| 1207 | + | |
| 1208 | + $this->fields['booking_resources_catalog_renderer'] = array( | |
| 1209 | + 'type' => 'select', | |
| 1210 | + 'default' => 'new', | |
| 1211 | + 'title' => __( 'Use legacy catalog pages', 'booking' ), | |
| 1212 | + 'description' => $description, | |
| 1213 | + 'options' => array( | |
| 1214 | + 'new' => __( 'No — use the new catalogs', 'booking' ), | |
| 1215 | + 'legacy' => __( 'Yes — use legacy catalog pages (Deprecated)', 'booking' ), | |
| 1216 | + ), | |
| 1217 | + 'group' => 'advanced', | |
| 1218 | + 'disabled' => ! $is_pro_compatible, | |
| 1219 | + ); | |
| 1220 | + | |
| 1221 | + if ( ! $is_pro_compatible ) { | |
| 1222 | + $this->fields['booking_resources_catalog_renderer']['value'] = 'legacy'; | |
| 1223 | + } | |
| 1224 | + } | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + $this->fields = apply_filters( 'wpbc_settings_edit_url_hash', $this->fields, $default_options_values ); | |
| 1228 | + // FixIn: 10.10.1.2 $this->fields = apply_filters( 'wpbc_settings_resource_no_update__during_editing', $this->fields, $default_options_values ); | |
| 1388 | 1229 | |
| 1389 | - // <editor-fold defaultstate="collapsed" desc=" Capacity " > | |
| 1230 | + // Show advanced settings of JavaScript loading | |
| 1390 | 1231 | |
| 1391 | - $this->fields = apply_filters( 'wpbc_settings_capacity_based_on_visitors', $this->fields, $default_options_values ); | |
| 1392 | 1232 | |
| 1393 | - $this->fields['booking_is_days_always_available'] = array( | |
| 1394 | - 'type' => 'checkbox' | |
| 1395 | - , 'default' => $default_options_values['booking_is_days_always_available'] //'On' | |
| 1396 | - , 'title' => __('Allow unlimited bookings per same day(s)' ,'booking') | |
| 1397 | - /* translators: 1: ... */ | |
| 1398 | - , 'label' => sprintf( __( 'Check this box, if you want to %1$sset any days as available%2$s in calendar. Your visitors will be able to make %3$sunlimited bookings per same date(s) in calendar and do not see any booked date(s)%4$s of other visitors.', 'booking' ), '<strong>', '</strong>' , '<strong>', '</strong>' ) | |
| 1399 | - , 'description' => '' | |
| 1400 | - , 'group' => 'capacity' | |
| 1401 | - ); | |
| 1402 | - | |
| 1403 | - | |
| 1404 | - // FixIn: 8.3.2.2. | |
| 1405 | - if ( ! class_exists('wpdev_bk_biz_l') ) | |
| 1406 | - $this->fields['booking_is_show_pending_days_as_available'] = array( | |
| 1407 | - 'type' => 'checkbox' | |
| 1408 | - , 'default' => $default_options_values['booking_is_show_pending_days_as_available'] //_'Off' | |
| 1409 | - , 'title' => __('Use pending days as available' ,'booking') | |
| 1410 | - , 'label' => sprintf(__('Check this box if you want to show the pending days as available in calendars' ,'booking') ) | |
| 1411 | - , 'description' => '' | |
| 1412 | - , 'group' => 'capacity' | |
| 1413 | - , 'tr_class' => '' | |
| 1414 | - ); | |
| 1415 | - | |
| 1416 | - $this->fields = apply_filters( 'wpbc_settings_pending_days_as_available', $this->fields, $default_options_values ); | |
| 1417 | - | |
| 1418 | - | |
| 1419 | - | |
| 1420 | - // </editor-fold> | |
| 1421 | - | |
| 1422 | - // <editor-fold defaultstate="collapsed" desc=" Capacity Free example " > | |
| 1423 | - if ( ! class_exists('wpdev_bk_personal') ){ | |
| 1424 | - | |
| 1425 | - // Showing availability in tooltip | |
| 1426 | - $this->fields['booking_quantity_control__promote_upgrade'] = array( | |
| 1427 | - 'type' => 'checkbox' | |
| 1428 | - , 'default' => 'On' | |
| 1429 | - , 'value' => 'On' | |
| 1430 | - , 'title' => __('Booking Quantity Control' ,'booking') | |
| 1431 | - , 'label' => __('Enable this option to allow visitors to define the number of items they can book for specific dates or times within a single reservation. ' ,'booking') | |
| 1432 | - , 'description' => __('If disabled, visitors can book only one slot within a single reservation.' ,'booking') | |
| 1433 | - , 'description_tag' => 'p' | |
| 1434 | - , 'group' => 'capacity_upgrade' | |
| 1435 | - , 'tr_class' => 'wpbc_blur' | |
| 1436 | - ); | |
| 1437 | - $this->fields['booking_capacity_field__promote_upgrade'] = array( | |
| 1438 | - 'type' => 'select' | |
| 1439 | - , 'default' => 'items' | |
| 1440 | - , 'value' => 'items' | |
| 1441 | - , 'title' => __('Quantity field name', 'booking') | |
| 1442 | - , 'description' => sprintf( __( 'Select the field that will control how many slots visitors can book during the reservation process.' ,'booking'), '<b>', '</b>' ) | |
| 1443 | - , 'description_tag' => 'span' | |
| 1444 | - , 'css' => '' | |
| 1445 | - , 'tr_class' => 'wpbc_booking_capacity_field_settings wpbc_sub_settings_grayed' | |
| 1446 | - , 'options' => array( 'items' => __('Items' ,'booking') ) | |
| 1447 | - , 'group' => 'capacity_upgrade' | |
| 1448 | - , 'tr_class' => 'wpbc_blur' | |
| 1449 | - ); | |
| 1450 | - $this->fields['booking_is_dissbale_booking_for_different_sub_resources__promote_upgrade'] = array( | |
| 1451 | - 'type' => 'checkbox' | |
| 1452 | - , 'default' => 'On' | |
| 1453 | - , 'value' => 'On' | |
| 1454 | - , 'title' => __('Disable bookings in different booking resources' ,'booking') | |
| 1455 | - , 'label' => __('Check this box to disable reservations, which can be stored in different booking resources.' ,'booking') | |
| 1456 | - , 'description' => '<strong>' . esc_html__('Note' ,'booking') . '!</strong> ' . __('When checked, all reserved days must be at same booking resource otherwise error message will show.' ,'booking') | |
| 1457 | - , 'group' => 'capacity_upgrade' | |
| 1458 | - , 'tr_class' => 'wpbc_blur' | |
| 1459 | - ); | |
| 1460 | - $this->fields['capacity_upgrade__promote_upgrade'] = array( | |
| 1461 | - 'type' => 'pure_html' | |
| 1462 | - , 'group' => 'capacity_upgrade' | |
| 1463 | - , 'html' => '<tr><td colspan="2"> | |
| 1464 | - <div class="wpbc_widget_content" style="transform: translate(0) translateY(-10em);"> | |
| 1465 | - <div class="ui_container ui_container_toolbar ui_container_small" style="background: #fff;position: relative;"> | |
| 1466 | - <div class="ui_group ui_group__upgrade"> | |
| 1467 | - <div class="wpbc_upgrade_note wpbc_upgrade_theme_green"> | |
| 1468 | - <div>This <a target="_blank" href="https://wpbookingcalendar.com/features/#capacity">feature</a> | |
| 1469 | - is available in the <strong>Business Large or MultiUser version</strong>. | |
| 1470 | - <a target="_blank" href="https://wpbookingcalendar.com/prices/#bk_news_section">Upgrade to Pro</a>. | |
| 1471 | - </div> | |
| 1472 | - </div> | |
| 1473 | - </div> | |
| 1474 | - </div> | |
| 1475 | - </div> | |
| 1476 | - </td> </tr>' | |
| 1477 | - ); | |
| 1478 | - } | |
| 1479 | - // </editor-fold> | |
| 1480 | - | |
| 1481 | - | |
| 1482 | - // <editor-fold defaultstate="collapsed" desc=" Advanced " > | |
| 1483 | - | |
| 1484 | - | |
| 1485 | - $this->fields = apply_filters( 'wpbc_settings_edit_url_hash', $this->fields, $default_options_values ); | |
| 1486 | - $this->fields = apply_filters( 'wpbc_settings_resource_no_update__during_editing', $this->fields, $default_options_values ); | |
| 1487 | - | |
| 1488 | - // Show advanced settings of JavaScript loading | |
| 1489 | - | |
| 1490 | - | |
| 1491 | 1233 | // //Show | Hide links for Advanced JavaScript section |
| 1492 | 1234 | // $this->fields['booking_advanced_js_loading_settings'] = array( |
| 1493 | 1235 | // 'type' => 'html' |
| 1494 | 1236 | // , 'html' => |
| @@ -1517,9 +1259,9 @@ | ||
| 1517 | 1259 | |
| 1518 | 1260 | |
| 1519 | 1261 | $this->fields['booking_is_load_js_css_on_specific_pages'] = array( |
| 1520 | 1262 | 'type' => 'checkbox' |
| 1521 | - , 'default' => $default_options_values['booking_is_load_js_css_on_specific_pages'] //'Off' | |
| 1263 | + , 'default' => $default_options_values['booking_is_load_js_css_on_specific_pages'] //'Off' | |
| 1522 | 1264 | , 'title' => __('Load JS and CSS files only on specific pages' ,'booking') |
| 1523 | 1265 | , 'label' => __('Activate loading of CSS and JavaScript files of plugin only at specific pages.' ,'booking') |
| 1524 | 1266 | , 'description' => '' |
| 1525 | 1267 | , 'group' => 'advanced' |
| @@ -1524,10 +1266,10 @@ | ||
| 1524 | 1266 | , 'description' => '' |
| 1525 | 1267 | , 'group' => 'advanced' |
| 1526 | 1268 | , 'tr_class' => 'wpbc_advanced_js_loading_settings'//wpbc_advanced_js_loading_settings wpbc_sub_settings_grayed hidden_items' |
| 1527 | 1269 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1528 | - ); | |
| 1529 | - $this->fields['booking_pages_for_load_js_css'] = array( | |
| 1270 | + ); | |
| 1271 | + $this->fields['booking_pages_for_load_js_css'] = array( | |
| 1530 | 1272 | 'type' => 'textarea' |
| 1531 | 1273 | , 'default' => $default_options_values['booking_pages_for_load_js_css'] //'' |
| 1532 | 1274 | , 'placeholder' => '/booking-form/' |
| 1533 | 1275 | , 'title' => __('Relative URLs of pages, where to load plugin CSS and JS files' ,'booking') |
| @@ -1552,11 +1294,11 @@ | ||
| 1552 | 1294 | ); |
| 1553 | 1295 | |
| 1554 | 1296 | //$this->fields['hr_booking_is_show_system_debug_log'] = array( 'type' => 'hr', 'group' => 'advanced', 'tr_class' => 'wpbc_advanced_js_loading_settings' ); // wpbc_sub_settings_grayed hidden_items' ); |
| 1555 | 1297 | // FixIn: 7.2.1.15. |
| 1556 | - $this->fields[ 'booking_is_show_system_debug_log' ] = array( | |
| 1298 | + $this->fields[ 'booking_is_show_system_debug_log' ] = array( | |
| 1557 | 1299 | 'type' => 'checkbox' |
| 1558 | - , 'default' => $default_options_values['booking_is_show_system_debug_log'] //'Off' | |
| 1300 | + , 'default' => $default_options_values['booking_is_show_system_debug_log'] //'Off' | |
| 1559 | 1301 | , 'title' => __('Show system debugging log for beta features' ,'booking') |
| 1560 | 1302 | , 'label' => __('Activate this option only for testing beta features' ,'booking') |
| 1561 | 1303 | , 'description' => '' |
| 1562 | 1304 | , 'group' => 'advanced' |
| @@ -1584,33 +1326,33 @@ | ||
| 1584 | 1326 | 'cols' => 2, |
| 1585 | 1327 | 'tr_class' => 'wpbc_advanced_js_loading_settings'// wpbc_sub_settings_grayed hidden_items' |
| 1586 | 1328 | ); |
| 1587 | 1329 | } |
| 1588 | - | |
| 1330 | + | |
| 1589 | 1331 | // Divider /////////////////////////////////////////////////////////////// |
| 1590 | 1332 | $this->fields['hr_calendar_before_advanced_js_loading_settings'] = array( 'type' => 'hr', 'group' => 'advanced' ); |
| 1591 | 1333 | |
| 1592 | 1334 | // Show settings of powered by notice |
| 1593 | - $this->fields['booking_advanced_powered_by_notice_settings'] = array( | |
| 1335 | + $this->fields['booking_advanced_powered_by_notice_settings'] = array( | |
| 1594 | 1336 | 'type' => 'html' |
| 1595 | - , 'html' => | |
| 1337 | + , 'html' => | |
| 1596 | 1338 | '<a id="wpbc_powered_by_link_show" class="wpbc_expand_section_link" href="javascript:void(0)">+ ' . __('Show settings of powered by notice' ,'booking') . '</a>' |
| 1597 | 1339 | . '<a id="wpbc_powered_by_link_hide" class="wpbc_expand_section_link" href="javascript:void(0)" style="display:none;">- ' . __('Hide settings of powered by notice' ,'booking') . '</a>' |
| 1598 | 1340 | , 'cols' => 2 |
| 1599 | 1341 | , 'group' => 'advanced' |
| 1600 | 1342 | ); |
| 1601 | - $this->fields['booking_is_show_powered_by_notice'] = array( | |
| 1343 | + $this->fields['booking_is_show_powered_by_notice'] = array( | |
| 1602 | 1344 | 'type' => 'checkbox' |
| 1603 | - , 'default' => $default_options_values['booking_is_show_powered_by_notice'] //'On' | |
| 1345 | + , 'default' => $default_options_values['booking_is_show_powered_by_notice'] //'On' | |
| 1604 | 1346 | , 'title' => __('Powered by notice' ,'booking') |
| 1605 | 1347 | , 'label' => sprintf(__(' Turn On/Off powered by "Booking Calendar" notice under the calendar.' ,'booking'),'wpbookingcalendar.com') |
| 1606 | 1348 | , 'description' => '' |
| 1607 | 1349 | , 'group' => 'advanced' |
| 1608 | 1350 | , 'tr_class' => 'wpbc_is_show_powered_by_notice wpbc_sub_settings_grayed hidden_items' |
| 1609 | - ); | |
| 1610 | - $this->fields['booking_wpdev_copyright_adminpanel'] = array( | |
| 1351 | + ); | |
| 1352 | + $this->fields['booking_wpdev_copyright_adminpanel'] = array( | |
| 1611 | 1353 | 'type' => 'checkbox' |
| 1612 | - , 'default' => $default_options_values['booking_wpdev_copyright_adminpanel'] //'On' | |
| 1354 | + , 'default' => $default_options_values['booking_wpdev_copyright_adminpanel'] //'On' | |
| 1613 | 1355 | , 'title' => __('Help and info notices' ,'booking') |
| 1614 | 1356 | , 'label' => sprintf(__(' Turn On/Off version notice and help info links at booking admin panel.' ,'booking'),'wpbookingcalendar.com') |
| 1615 | 1357 | , 'description' => '' |
| 1616 | 1358 | , 'group' => 'advanced' |
| @@ -1615,31 +1357,31 @@ | ||
| 1615 | 1357 | , 'description' => '' |
| 1616 | 1358 | , 'group' => 'advanced' |
| 1617 | 1359 | , 'tr_class' => 'wpbc_is_show_powered_by_notice wpbc_sub_settings_grayed hidden_items' |
| 1618 | 1360 | , 'is_demo_safe' => wpbc_is_this_demo() // FixIn: 8.1.3.9. |
| 1619 | - ); | |
| 1620 | - | |
| 1361 | + ); | |
| 1362 | + | |
| 1621 | 1363 | // </editor-fold> |
| 1622 | - | |
| 1623 | - | |
| 1364 | + | |
| 1365 | + | |
| 1624 | 1366 | // <editor-fold defaultstate="collapsed" desc=" Information " > |
| 1625 | 1367 | if(1){ |
| 1626 | 1368 | if ( function_exists( 'wpbc_get_dashboard_info' ) ) { |
| 1627 | - $this->fields['booking_information'] = array( | |
| 1369 | + $this->fields['booking_information'] = array( | |
| 1628 | 1370 | 'type' => 'html' |
| 1629 | 1371 | , 'html' => wpbc_get_dashboard_info() |
| 1630 | 1372 | , 'cols' => 2 |
| 1631 | 1373 | , 'group' => 'information' |
| 1632 | - ); | |
| 1374 | + ); | |
| 1633 | 1375 | } |
| 1634 | 1376 | } |
| 1635 | 1377 | // </editor-fold> |
| 1636 | 1378 | |
| 1637 | - | |
| 1379 | + | |
| 1638 | 1380 | // <editor-fold defaultstate="collapsed" desc=" User permissions for plugin menu pages " > |
| 1639 | - | |
| 1640 | - | |
| 1641 | - $this->fields['booking_menu_position'] = array( | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + $this->fields['booking_menu_position'] = array( | |
| 1642 | 1384 | 'type' => 'select' |
| 1643 | 1385 | , 'default' => 'top' |
| 1644 | 1386 | , 'title' => __('Plugin menu position', 'booking') |
| 1645 | 1387 | , 'description' => '' |
| @@ -1650,10 +1392,10 @@ | ||
| 1650 | 1392 | ) |
| 1651 | 1393 | , 'group' => 'permissions' |
| 1652 | 1394 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1653 | 1395 | ); |
| 1654 | - | |
| 1655 | - $this->fields['booking_user_role_booking_header'] = array( | |
| 1396 | + | |
| 1397 | + $this->fields['booking_user_role_booking_header'] = array( | |
| 1656 | 1398 | 'type' => 'pure_html' |
| 1657 | 1399 | , 'group' => 'permissions' |
| 1658 | 1400 | , 'html' => '<tr valign="top"> |
| 1659 | 1401 | <th scope="row" colspan="2"> |
| @@ -1659,10 +1401,10 @@ | ||
| 1659 | 1401 | <th scope="row" colspan="2"> |
| 1660 | 1402 | <hr/><p><strong>' . wp_kses_post( __('User permissions for plugin menu pages' ,'booking') ) . ':</strong></p> |
| 1661 | 1403 | </th> |
| 1662 | 1404 | </tr>' |
| 1663 | - ); | |
| 1664 | - | |
| 1405 | + ); | |
| 1406 | + | |
| 1665 | 1407 | $field_options = array(); |
| 1666 | 1408 | $field_options['subscriber'] = translate_user_role('Subscriber'); |
| 1667 | 1409 | $field_options['contributor'] = translate_user_role('Contributor'); |
| 1668 | 1410 | $field_options['author'] = translate_user_role('Author'); |
| @@ -1667,12 +1409,12 @@ | ||
| 1667 | 1409 | $field_options['contributor'] = translate_user_role('Contributor'); |
| 1668 | 1410 | $field_options['author'] = translate_user_role('Author'); |
| 1669 | 1411 | $field_options['editor'] = translate_user_role('Editor'); |
| 1670 | 1412 | $field_options['administrator'] = translate_user_role('Administrator'); |
| 1671 | - | |
| 1672 | - $this->fields['booking_user_role_booking'] = array( | |
| 1413 | + | |
| 1414 | + $this->fields['booking_user_role_booking'] = array( | |
| 1673 | 1415 | 'type' => 'select' |
| 1674 | - , 'default' => $default_options_values['booking_user_role_booking'] //'editor' | |
| 1416 | + , 'default' => $default_options_values['booking_user_role_booking'] //'editor' | |
| 1675 | 1417 | , 'title' => __('Bookings', 'booking') |
| 1676 | 1418 | , 'description' => '' |
| 1677 | 1419 | , 'options' => $field_options |
| 1678 | 1420 | , 'group' => 'permissions' |
| @@ -1708,11 +1450,11 @@ | ||
| 1708 | 1450 | , 'group' => 'permissions' |
| 1709 | 1451 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1710 | 1452 | ); |
| 1711 | 1453 | if ( class_exists( 'wpdev_bk_personal' ) ) |
| 1712 | - $this->fields['booking_user_role_resources'] = array( | |
| 1454 | + $this->fields['booking_user_role_resources'] = array( | |
| 1713 | 1455 | 'type' => 'select' |
| 1714 | - , 'default' => $default_options_values['booking_user_role_resources'] //'editor' | |
| 1456 | + , 'default' => $default_options_values['booking_user_role_resources'] //'editor' | |
| 1715 | 1457 | , 'title' => __('Resources', 'booking') |
| 1716 | 1458 | , 'description' => '' |
| 1717 | 1459 | , 'options' => $field_options |
| 1718 | 1460 | , 'group' => 'permissions' |
| @@ -1728,9 +1470,10 @@ | ||
| 1728 | 1470 | , 'group' => 'permissions' |
| 1729 | 1471 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1730 | 1472 | ); |
| 1731 | 1473 | |
| 1732 | - if ( ! class_exists( 'wpdev_bk_personal' ) ) | |
| 1474 | + //if ( ! class_exists( 'wpdev_bk_personal' ) ) | |
| 1475 | + if ( ! wpbc_is_this_demo() ) | |
| 1733 | 1476 | $this->fields['booking_menu_go_pro'] = array( |
| 1734 | 1477 | 'type' => 'select' |
| 1735 | 1478 | , 'default' => $default_options_values['booking_menu_go_pro'] //'administrator' |
| 1736 | 1479 | , 'title' => __('Premium', 'booking') |
| @@ -1744,27 +1487,27 @@ | ||
| 1744 | 1487 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1745 | 1488 | ); |
| 1746 | 1489 | |
| 1747 | 1490 | if ( wpbc_is_this_demo() ) |
| 1748 | - $this->fields['booking_user_role_settings_demo'] = array( 'group' => 'permissions', 'type' => 'html', 'html' => wpbc_get_warning_text_in_demo_mode(), 'cols' => 2 ); | |
| 1749 | - | |
| 1750 | - | |
| 1491 | + $this->fields['booking_user_role_settings_demo'] = array( 'group' => 'permissions', 'type' => 'html', 'html' => wpbc_get_warning_text_in_demo_mode(), 'cols' => 2 ); | |
| 1492 | + | |
| 1493 | + | |
| 1751 | 1494 | // </editor-fold> |
| 1752 | - | |
| 1753 | - | |
| 1495 | + | |
| 1496 | + | |
| 1754 | 1497 | // <editor-fold defaultstate="collapsed" desc=" Uninstall " > |
| 1755 | - $this->fields['booking_is_delete_if_deactive'] = array( | |
| 1498 | + $this->fields['booking_is_delete_if_deactive'] = array( | |
| 1756 | 1499 | 'type' => 'checkbox' |
| 1757 | - , 'default' => $default_options_values['booking_is_delete_if_deactive'] //'Off' | |
| 1500 | + , 'default' => $default_options_values['booking_is_delete_if_deactive'] //'Off' | |
| 1758 | 1501 | , 'title' => __('Delete booking data, when plugin deactivated' ,'booking') |
| 1759 | - , 'label' => __('Check this box to delete all booking data when you uninstal this plugin.' ,'booking') | |
| 1502 | + , 'label' => __('Turn on to delete all booking data when you uninstall this plugin.' ,'booking') | |
| 1760 | 1503 | , 'description' => '' |
| 1761 | 1504 | , 'group' => 'uninstall' |
| 1762 | 1505 | , 'toggle_class' => 'wpbc_toggle_danger' |
| 1763 | - ); | |
| 1506 | + ); | |
| 1764 | 1507 | // </editor-fold> |
| 1765 | - | |
| 1766 | - | |
| 1508 | + | |
| 1509 | + | |
| 1767 | 1510 | // <editor-fold defaultstate="collapsed" desc=" Tools " > |
| 1768 | 1511 | |
| 1769 | 1512 | if ( ( ! wpbc_is_this_demo() ) && ( current_user_can( 'activate_plugins' ) ) ) { |
| 1770 | 1513 | |
| @@ -1793,8 +1536,28 @@ | ||
| 1793 | 1536 | . '&wh_booking_type=lost">' |
| 1794 | 1537 | . 'Find Lost Bookings' |
| 1795 | 1538 | . '</a>'; // FixIn: 8.5.2.19. |
| 1796 | 1539 | |
| 1540 | + | |
| 1541 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 1542 | + if ( ( ! empty( $_REQUEST['booking_version_num'] ) ) && ( 'reset' == $_REQUEST['booking_version_num'] ) ) { // FixIn: 8.5.2.19. | |
| 1543 | + delete_bk_option('booking_version_num'); | |
| 1544 | + ?> | |
| 1545 | + <div class="wpdvlp-sub-tabs wpbc_redirection_message" | |
| 1546 | + style="margin: 20px 0;padding: 1em;font-size: 14px;"> | |
| 1547 | + <a href="<?php | |
| 1548 | + echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>">Redirect</a> after <span | |
| 1549 | + class="wpbc_countdown">1</span> second... | |
| 1550 | + </div> | |
| 1551 | + <?php | |
| 1552 | + | |
| 1553 | + wpbc_redirect( wpbc_get_settings_url() ); | |
| 1554 | + } | |
| 1555 | + | |
| 1556 | + $my_system_buttons .= ' <a class="button button" href="' . wpbc_get_settings_url() . '&booking_version_num=reset">' . 'Try to Reinstall' . '</a>'; // FixIn: 8.5.2.19. | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1797 | 1560 | // FixIn: 9.5.3.1. |
| 1798 | 1561 | $my_system_buttons .= ' <a class="button button" href="' |
| 1799 | 1562 | . wpbc_get_resources_url() |
| 1800 | 1563 | . '&show_all_resources=1">' |
| @@ -1882,18 +1645,18 @@ | ||
| 1882 | 1645 | , 'description_tag' => 'p' |
| 1883 | 1646 | ); |
| 1884 | 1647 | // </editor-fold> |
| 1885 | 1648 | |
| 1886 | - } | |
| 1887 | - | |
| 1649 | + } | |
| 1888 | 1650 | |
| 1651 | + | |
| 1889 | 1652 | /** |
| 1890 | 1653 | * Add Custon JavaScript - for some specific settings options |
| 1891 | 1654 | * Need to executes after showing of entire settings page (on hook: wpbc_after_settings_content). |
| 1892 | 1655 | * After initial definition of settings, and possible definition after POST request. |
| 1893 | - * | |
| 1656 | + * | |
| 1894 | 1657 | * @param type $menu_slug |
| 1895 | - * | |
| 1658 | + * | |
| 1896 | 1659 | */ |
| 1897 | 1660 | public function enqueue_js( $menu_slug, $active_page_tab, $active_page_subtab ) { |
| 1898 | 1661 | |
| 1899 | 1662 | $js_script = ''; |
| @@ -1919,9 +1682,9 @@ | ||
| 1919 | 1682 | $js_script .= " |
| 1920 | 1683 | if ( ! jQuery('#set_gen_booking_is_show_legend').is(':checked') ) { |
| 1921 | 1684 | jQuery('.wpbc_calendar_legend_items').addClass('hidden_items'); |
| 1922 | 1685 | } |
| 1923 | - "; | |
| 1686 | + "; | |
| 1924 | 1687 | // Hide or Show Legend items on click checkbox |
| 1925 | 1688 | $js_script .= " jQuery('#set_gen_booking_is_show_legend').on( 'change', function(){ |
| 1926 | 1689 | if ( this.checked ) { |
| 1927 | 1690 | jQuery('.wpbc_calendar_legend_items').removeClass('hidden_items'); |
| @@ -1927,9 +1690,9 @@ | ||
| 1927 | 1690 | jQuery('.wpbc_calendar_legend_items').removeClass('hidden_items'); |
| 1928 | 1691 | } else { |
| 1929 | 1692 | jQuery('.wpbc_calendar_legend_items').addClass('hidden_items'); |
| 1930 | 1693 | } |
| 1931 | - } ); "; | |
| 1694 | + } ); "; | |
| 1932 | 1695 | // Thank you Message or Page |
| 1933 | 1696 | $js_script .= " |
| 1934 | 1697 | if ( jQuery('#type_of_thank_you_message_message').is(':checked') ) { |
| 1935 | 1698 | jQuery('.wpbc_calendar_thank_you_page').addClass('hidden_items'); |
| @@ -1936,9 +1699,9 @@ | ||
| 1936 | 1699 | } |
| 1937 | 1700 | if ( jQuery('#type_of_thank_you_message_page').is(':checked') ) { |
| 1938 | 1701 | jQuery('.wpbc_calendar_thank_you_message').addClass('hidden_items'); |
| 1939 | 1702 | } |
| 1940 | - "; | |
| 1703 | + "; | |
| 1941 | 1704 | $js_script .= " jQuery('input[name=\"set_gen_booking_type_of_thank_you_message\"]').on( 'change', function(){ |
| 1942 | 1705 | if ( jQuery('#type_of_thank_you_message_message').is(':checked') ) { |
| 1943 | 1706 | jQuery('.wpbc_calendar_thank_you_message').removeClass('hidden_items'); |
| 1944 | 1707 | jQuery('.wpbc_calendar_thank_you_page').addClass('hidden_items'); |
| @@ -1945,10 +1708,10 @@ | ||
| 1945 | 1708 | } else { |
| 1946 | 1709 | jQuery('.wpbc_calendar_thank_you_message').addClass('hidden_items'); |
| 1947 | 1710 | jQuery('.wpbc_calendar_thank_you_page').removeClass('hidden_items'); |
| 1948 | 1711 | } |
| 1949 | - } ); "; | |
| 1950 | - | |
| 1712 | + } ); "; | |
| 1713 | + | |
| 1951 | 1714 | // Default calendar view mode (Booking Listing) - set active / inctive options depend from resource selection. |
| 1952 | 1715 | $js_script .= " jQuery('#set_gen_booking_view_days_num').on( 'focus', function(){ |
| 1953 | 1716 | if ( jQuery('#set_gen_booking_default_booking_resource').length > 0 ) { |
| 1954 | 1717 | jQuery('#set_gen_booking_default_booking_resource').on('change', function() { |
| @@ -1969,10 +1732,10 @@ | ||
| 1969 | 1732 | jQuery('#set_gen_booking_view_days_num option:eq(4)').prop('disabled', false); |
| 1970 | 1733 | jQuery('#set_gen_booking_view_days_num option:eq(5)').prop('disabled', false); |
| 1971 | 1734 | } |
| 1972 | 1735 | } |
| 1973 | - } ); "; | |
| 1974 | - | |
| 1736 | + } ); "; | |
| 1737 | + | |
| 1975 | 1738 | //////////////////////////////////////////////////////////////////////// |
| 1976 | 1739 | // Set correct value for dates format, depend on from selection of radio buttons |
| 1977 | 1740 | $booking_date_format = esc_js( get_bk_option( 'booking_date_format') ); // FixIn: 10.6.1.2. |
| 1978 | 1741 | // On initial Load set correct text value and correct radio button |
| @@ -2001,14 +1764,14 @@ | ||
| 2001 | 1764 | return '&#'+i.charCodeAt(0)+';'; |
| 2002 | 1765 | }) |
| 2003 | 1766 | ); |
| 2004 | 1767 | } |
| 2005 | - } ); "; | |
| 2006 | - // If we edit custom "Date Format" Text field - select Custom Radio button. | |
| 1768 | + } ); "; | |
| 1769 | + // If we edit custom "Date Format" Text field - select Custom Radio button. | |
| 2007 | 1770 | $js_script .= " jQuery('#set_gen_booking_date_format').on( 'change', function(){ |
| 2008 | 1771 | jQuery( '#date_format_selection_custom' ).prop('checked', true); |
| 2009 | - } ); "; | |
| 2010 | - | |
| 1772 | + } ); "; | |
| 1773 | + | |
| 2011 | 1774 | //////////////////////////////////////////////////////////////////////// |
| 2012 | 1775 | // Set correct value for Time Format, depend on from selection of radio buttons |
| 2013 | 1776 | $booking_time_format = esc_js( get_bk_option( 'booking_time_format') ); // FixIn: 10.6.1.2. |
| 2014 | 1777 | // Function to load on initial stage of page loading, set correct value of text and select correct radio button. |
| @@ -2043,42 +1806,8 @@ | ||
| 2043 | 1806 | $js_script .= " jQuery('#set_gen_booking_time_format').on( 'change', function(){ |
| 2044 | 1807 | jQuery( '#time_format_selection_custom' ).prop('checked', true); |
| 2045 | 1808 | } ); "; |
| 2046 | 1809 | |
| 2047 | - //////////////////////////////////////////////////////////////////////// | |
| 2048 | - // Advanced section | |
| 2049 | - //////////////////////////////////////////////////////////////////////// | |
| 2050 | - | |
| 2051 | - // Click on "Always available " | |
| 2052 | - $js_script .= " jQuery('#set_gen_booking_is_days_always_available').on( 'change', function(){ | |
| 2053 | - if ( this.checked ) { | |
| 2054 | - var answer = confirm('" | |
| 2055 | - . esc_js( __( 'Warning', 'booking' ) ) . '! ' | |
| 2056 | - . esc_js( __( 'You allow unlimited number of bookings per same dates, its can be a reason of double bookings on the same date. Do you really want to do this?', 'booking' ) ) | |
| 2057 | - . "' ); | |
| 2058 | - if ( answer) { | |
| 2059 | - this.checked = true; | |
| 2060 | - jQuery('#set_gen_booking_quantity_control').prop('checked', false ).trigger('change'); | |
| 2061 | - jQuery('#set_gen_booking_is_show_pending_days_as_available').prop('checked', false ); | |
| 2062 | - jQuery('.wpbc_pending_days_as_available_sub_settings').addClass('hidden_items'); | |
| 2063 | - } else { | |
| 2064 | - this.checked = false; | |
| 2065 | - } | |
| 2066 | - } | |
| 2067 | - } ); "; | |
| 2068 | - | |
| 2069 | - // FixIn: 8.3.2.2. | |
| 2070 | - if ( ! class_exists('wpdev_bk_biz_l') ) { | |
| 2071 | - // Click on "Use pending days as available" | |
| 2072 | - $js_script .= " jQuery('#set_gen_booking_is_show_pending_days_as_available').on( 'change', function(){ | |
| 2073 | - if ( this.checked ) { | |
| 2074 | - jQuery('#set_gen_booking_is_days_always_available').prop('checked', false ); | |
| 2075 | - } else { | |
| 2076 | - | |
| 2077 | - } | |
| 2078 | - } ); "; | |
| 2079 | - } | |
| 2080 | - | |
| 2081 | 1810 | // Click on Show Advanced JavaScript section link |
| 2082 | 1811 | $js_script .= " jQuery('#wpbc_show_advanced_section_link_show').on( 'click', function(){ |
| 2083 | 1812 | jQuery('#wpbc_show_advanced_section_link_show').toggle(200); |
| 2084 | 1813 | jQuery('#wpbc_show_advanced_section_link_hide').animate( {opacity: 1}, 200 ).toggle(200); |
| @@ -2086,19 +1815,19 @@ | ||
| 2086 | 1815 | |
| 2087 | 1816 | if ( ! jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').is(':checked') ) { |
| 2088 | 1817 | jQuery('.wpbc_is_load_js_css_on_specific_pages').addClass('hidden_items'); |
| 2089 | 1818 | } |
| 2090 | - } ); "; | |
| 1819 | + } ); "; | |
| 2091 | 1820 | $js_script .= " jQuery('#wpbc_show_advanced_section_link_hide').on( 'click', function(){ |
| 2092 | 1821 | jQuery('#wpbc_show_advanced_section_link_hide').toggle(200); |
| 2093 | 1822 | jQuery('#wpbc_show_advanced_section_link_show').animate( {opacity: 1}, 200 ).toggle(200); |
| 2094 | 1823 | jQuery('.wpbc_advanced_js_loading_settings').addClass('hidden_items'); |
| 2095 | - } ); "; | |
| 1824 | + } ); "; | |
| 2096 | 1825 | $js_script .= " jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').on( 'change', function(){ |
| 2097 | 1826 | if ( this.checked ) { |
| 2098 | - var answer = confirm('" | |
| 1827 | + var answer = confirm('" | |
| 2099 | 1828 | . esc_js( __( 'Warning', 'booking' ) ) . '! ' |
| 2100 | - . esc_js( __( 'You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?', 'booking' ) ) | |
| 1829 | + . esc_js( __( 'You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?', 'booking' ) ) | |
| 2101 | 1830 | . "' ); |
| 2102 | 1831 | if ( answer) { |
| 2103 | 1832 | this.checked = true; |
| 2104 | 1833 | jQuery('.wpbc_is_load_js_css_on_specific_pages').removeClass('hidden_items'); |
| @@ -2112,30 +1841,30 @@ | ||
| 2112 | 1841 | if ( ! jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').is(':checked') ) { |
| 2113 | 1842 | jQuery('.wpbc_is_load_js_css_on_specific_pages').addClass('hidden_items'); |
| 2114 | 1843 | } |
| 2115 | 1844 | |
| 2116 | - "; | |
| 2117 | - | |
| 2118 | - | |
| 1845 | + "; | |
| 1846 | + | |
| 1847 | + | |
| 2119 | 1848 | // Click on Powered by links |
| 2120 | 1849 | $js_script .= " jQuery('#wpbc_powered_by_link_show').on( 'click', function(){ |
| 2121 | 1850 | jQuery('#wpbc_powered_by_link_show').toggle(200); |
| 2122 | 1851 | jQuery('#wpbc_powered_by_link_hide').animate( {opacity: 1}, 200 ).toggle(200); |
| 2123 | 1852 | jQuery('.wpbc_is_show_powered_by_notice').removeClass('hidden_items'); |
| 2124 | - } ); "; | |
| 1853 | + } ); "; | |
| 2125 | 1854 | $js_script .= " jQuery('#wpbc_powered_by_link_hide').on( 'click', function(){ |
| 2126 | 1855 | jQuery('#wpbc_powered_by_link_hide').toggle(200); |
| 2127 | 1856 | jQuery('#wpbc_powered_by_link_show').animate( {opacity: 1}, 200 ).toggle(200); |
| 2128 | 1857 | jQuery('.wpbc_is_show_powered_by_notice').addClass('hidden_items'); |
| 2129 | - } ); "; | |
| 1858 | + } ); "; | |
| 2130 | 1859 | |
| 2131 | - | |
| 1860 | + | |
| 2132 | 1861 | // Show confirmation window, if user activate this checkbox |
| 2133 | 1862 | $js_script .= " jQuery('#set_gen_booking_is_delete_if_deactive').on( 'change', function(){ |
| 2134 | 1863 | if ( this.checked ) { |
| 2135 | - var answer = confirm('" | |
| 1864 | + var answer = confirm('" | |
| 2136 | 1865 | . esc_js( __( 'Warning', 'booking' ) ) . '! ' |
| 2137 | - . esc_js( __( 'If you check this option, all booking data will be deleted when you uninstall this plugin. Do you really want to do this?', 'booking' ) ) | |
| 1866 | + . esc_js( __( 'If you check this option, all booking data will be deleted when you uninstall this plugin. Do you really want to do this?', 'booking' ) ) | |
| 2138 | 1867 | . "' ); |
| 2139 | 1868 | if ( answer) { |
| 2140 | 1869 | this.checked = true; |
| 2141 | 1870 | } else { |
| @@ -2142,63 +1871,12 @@ | ||
| 2142 | 1871 | this.checked = false; |
| 2143 | 1872 | } |
| 2144 | 1873 | } |
| 2145 | 1874 | } ); |
| 2146 | - "; | |
| 1875 | + "; | |
| 2147 | 1876 | |
| 2148 | 1877 | |
| 2149 | - // Select specific Time Picker skin, depending from selection of Calendar skin // FixIn: 8.7.11.10. | |
| 2150 | - $js_script .= " jQuery('#set_gen_booking_skin').on( 'change', function(){ | |
| 2151 | - | |
| 2152 | - var wpbc_selected_skin = jQuery('select[name=\"set_gen_booking_skin\"] option:selected').val(); | |
| 2153 | - var wpbc_cal_skin_arr = [ | |
| 2154 | - '/css/skins/black-2.css', | |
| 2155 | - '/css/skins/black.css', | |
| 2156 | - '/css/skins/multidays.css', | |
| 2157 | - '/css/skins/premium-black.css', | |
| 2158 | - '/css/skins/premium-light.css', | |
| 2159 | - '/css/skins/premium-marine.css', | |
| 2160 | - '/css/skins/premium-steel.css', | |
| 2161 | - '/css/skins/standard.css', | |
| 2162 | - '/css/skins/traditional-light.css', | |
| 2163 | - '/css/skins/traditional.css', | |
| 2164 | - '/css/skins/green-01.css' | |
| 2165 | - ]; | |
| 2166 | - var wpbc_time_skin_arr = [ | |
| 2167 | - '/css/time_picker_skins/black.css', | |
| 2168 | - '/css/time_picker_skins/black.css', | |
| 2169 | - '/css/time_picker_skins/green.css', | |
| 2170 | - '/css/time_picker_skins/black.css', | |
| 2171 | - '/css/time_picker_skins/light__24_8.css', | |
| 2172 | - '/css/time_picker_skins/marine.css', | |
| 2173 | - '/css/time_picker_skins/light__24_8.css', | |
| 2174 | - '/css/time_picker_skins/blue.css', | |
| 2175 | - '/css/time_picker_skins/orange.css', | |
| 2176 | - '/css/time_picker_skins/light__24_8.css', | |
| 2177 | - '/css/time_picker_skins/light__24_8.css' | |
| 2178 | - ]; | |
| 2179 | - if ( wpbc_cal_skin_arr.indexOf( wpbc_selected_skin ) >= 0 ) { | |
| 2180 | - jQuery( '#set_gen_booking_timeslot_picker_skin' ).find( 'option' ).prop( 'selected', false ); | |
| 2181 | - jQuery( '#set_gen_booking_timeslot_picker_skin' ).find( 'option[value=\"'+ wpbc_time_skin_arr[ wpbc_cal_skin_arr.indexOf( wpbc_selected_skin ) ] +'\"]' ).prop( 'selected', true ); | |
| 2182 | - } | |
| 2183 | - | |
| 2184 | - } ); "; | |
| 2185 | 1878 | |
| 2186 | - // If selected Dark theme then select Dark calendar skin, as well. | |
| 2187 | - $js_script .= " jQuery('#set_gen_booking_form_theme').on( 'change', function(){ | |
| 2188 | - var wpbc_selected_theme = jQuery('select[name=\"set_gen_booking_form_theme\"] option:selected').val(); | |
| 2189 | - var wpbc_cal_dark_skin_path = '/css/skins/24_9__dark_1.css'; | |
| 2190 | - if ( 'wpbc_theme_dark_1' === wpbc_selected_theme ) { | |
| 2191 | - jQuery( '#set_gen_booking_skin' ).find( 'option' ).prop( 'selected', false ); | |
| 2192 | - jQuery( '#set_gen_booking_skin' ).find( 'option[value=\"'+ wpbc_cal_dark_skin_path +'\"]' ).prop( 'selected', true ).trigger('change'); | |
| 2193 | - } | |
| 2194 | - var wpbc_cal_light_skin_path = '/css/skins/24_9__light_square_1.css'; | |
| 2195 | - if ( '' === wpbc_selected_theme ) { | |
| 2196 | - jQuery( '#set_gen_booking_skin' ).find( 'option' ).prop( 'selected', false ); | |
| 2197 | - jQuery( '#set_gen_booking_skin' ).find( 'option[value=\"'+ wpbc_cal_light_skin_path +'\"]' ).prop( 'selected', true ).trigger('change'); | |
| 2198 | - } | |
| 2199 | - | |
| 2200 | - } ); "; | |
| 2201 | 1879 | |
| 2202 | 1880 | |
| 2203 | 1881 | // ============================================================================================================= // FixIn: 10.1.5.4. |
| 2204 | 1882 | // 'Dates selection' - some options hide or show |
| @@ -2340,12 +2018,61 @@ | ||
| 2340 | 2018 | } ); "; |
| 2341 | 2019 | |
| 2342 | 2020 | |
| 2343 | 2021 | // Enqueue JS to the footer of the page |
| 2344 | - wpbc_enqueue_js( $js_script ); | |
| 2345 | - } | |
| 2346 | - | |
| 2347 | -} | |
| 2022 | + wpbc_enqueue_js( $js_script ); | |
| 2023 | + } | |
| 2024 | + | |
| 2025 | + /** | |
| 2026 | + * Validate the temporary shared 11.6 catalog renderer preference. | |
| 2027 | + * | |
| 2028 | + * The General Settings form verifies its nonce before invoking the Settings | |
| 2029 | + * API. This field adds an explicit capability boundary and allow list. When | |
| 2030 | + * compatibility forces disabled legacy views, the existing Resources-named | |
| 2031 | + * storage key is preserved instead of being overwritten by a derived value. | |
| 2032 | + * | |
| 2033 | + * @param string $post_key Full Settings API POST key. | |
| 2034 | + * | |
| 2035 | + * @return string Allow-listed stored renderer preference. | |
| 2036 | + */ | |
| 2037 | + public function validate_booking_resources_catalog_renderer_post( $post_key ) { | |
| 2038 | + $stored_renderer = wpbc_booking_resources_catalog_get_stored_renderer(); | |
| 2039 | + | |
| 2040 | + if ( ! wpbc_booking_resources_catalog_can_manage_settings() || ! wpbc_booking_resources_catalog_is_pro_compatible() ) { | |
| 2041 | + return $stored_renderer; | |
| 2042 | + } | |
| 2043 | + | |
| 2044 | + $submitted_renderer = self::validate_select_post_static( $post_key ); | |
| 2045 | + if ( ! is_string( $submitted_renderer ) || ! in_array( $submitted_renderer, array( 'new', 'legacy' ), true ) ) { | |
| 2046 | + return $stored_renderer; | |
| 2047 | + } | |
| 2048 | + | |
| 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; | |
| 2072 | + } | |
| 2073 | + | |
| 2074 | +} | |
| 2348 | 2075 | |
| 2349 | 2076 | |
| 2350 | 2077 | /** |
| 2351 | 2078 | * Override VALIDATED fields BEFORE saving to DB |
| @@ -2357,9 +2084,9 @@ | ||
| 2357 | 2084 | function wpbc_settings_validate_fields_before_saving__all( $validated_fields ) { |
| 2358 | 2085 | |
| 2359 | 2086 | |
| 2360 | 2087 | $validated_fields['booking_thank_you_page_URL'] = wpbc_make_link_relative( $validated_fields['booking_thank_you_page_URL'] ); |
| 2361 | - | |
| 2088 | + | |
| 2362 | 2089 | unset( $validated_fields[ 'booking_date_format_selection' ] ); // We do not need to this field, because saving to DB only: "date_format" field |
| 2363 | 2090 | unset( $validated_fields[ 'booking_time_format_selection' ] ); // We do not need to this field, because saving to DB only: "time_format" field |
| 2364 | 2091 | |
| 2365 | 2092 | // Unset promote fields |
| @@ -2392,9 +2119,9 @@ | ||
| 2392 | 2119 | if ( $is_use_code_mirror ) { |
| 2393 | 2120 | |
| 2394 | 2121 | wpbc_codemirror()->set_codemirror( array( |
| 2395 | 2122 | 'textarea_id' => '#set_gen_booking_confirmation__personal_info__content' |
| 2396 | - , 'preview_id' => '#wpbc_add_form_html_preview' | |
| 2123 | + // , 'preview_id' => '#wpbc_add_form_html_preview' | |
| 2397 | 2124 | ) ); |
| 2398 | 2125 | wpbc_codemirror()->set_codemirror( array( |
| 2399 | 2126 | 'textarea_id' => '#set_gen_booking_confirmation__booking_details__content' |
| 2400 | 2127 | // , 'preview_id' => '#wpbc_add_form_html_preview' |
| @@ -2401,5 +2128,5 @@ | ||
| 2401 | 2128 | ) ); |
| 2402 | 2129 | |
| 2403 | 2130 | } |
| 2404 | 2131 | } |
| 2405 | - //add_action( 'wpbc_hook_settings_page_footer', 'wpbc_hook_settings_page_footer__define_code_mirror' ); | |
| 2132 | + //add_action( 'wpbc_hook_settings_page_footer', 'wpbc_hook_settings_page_footer__define_code_mirror' ); | |