| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php /** |
| 2 | 2 | * @version 1.0 |
| 3 | 3 | * @package Booking Calendar |
| 4 | 4 | * @category UI Elements for Settings |
| @@ -430,9 +430,9 @@ | ||
| 430 | 430 | <a class="wpbc_ui_settings__text_color__black" onclick="<?php |
| 431 | 431 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 432 | 432 | echo $onclick; ?>" href="<?php |
| 433 | 433 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 434 | - echo $permalink; ?>"> <?php esc_html_e( 'Choose how users can select days: single day, multiple days, or a date range with minimum and maximum limits.', 'booking' ); ?> | |
| 434 | + echo $permalink; ?>"> <?php esc_html_e( 'Choose how users can select a single day, separate multiple days, or an unrestricted date range with two mouse clicks.', 'booking' ); ?> | |
| 435 | 435 | </a> |
| 436 | 436 | </div> |
| 437 | 437 | </div><?php |
| 438 | 438 | |
| @@ -539,9 +539,9 @@ | ||
| 539 | 539 | * @return void |
| 540 | 540 | */ |
| 541 | 541 | function wpbc_ui_settings_panel__card__general_availability( $params = array() ){ |
| 542 | 542 | |
| 543 | - $title = esc_attr__( 'General Availability', 'booking' ); | |
| 543 | + $title = esc_attr__( 'Schedule & Rules', 'booking' ); | |
| 544 | 544 | |
| 545 | 545 | $permalink = function_exists( 'wpbc_get_general_availability_url' ) ? wpbc_get_general_availability_url() : admin_url( 'admin.php?page=wpbc-availability&tab=general_availability' ); |
| 546 | 546 | $onclick = ""; |
| 547 | 547 | |
| @@ -618,16 +618,9 @@ | ||
| 618 | 618 | ?><div class="wpbc_ui_settings__flex_container wpbc_ui_settings__panel__form"><?php |
| 619 | 619 | |
| 620 | 620 | wpbc_ui_settings__panel_start(); |
| 621 | 621 | |
| 622 | - if ( WPBC_Frontend_Settings::is_bfb_enabled( null ) ) { | |
| 623 | - wpbc_ui_settings_panel__card__bfb( $params ); | |
| 624 | - } else { | |
| 625 | - wpbc_ui_settings_panel__card__form_fields( $params ); | |
| 626 | - wpbc_ui_settings_panel__card__time_fields( $params ); | |
| 627 | - wpbc_ui_settings_panel__card__time_slots_options( $params ); | |
| 628 | - wpbc_ui_settings_panel__card__form_options( $params ); | |
| 629 | - } | |
| 622 | + wpbc_ui_settings_panel__card__bfb( $params ); | |
| 630 | 623 | |
| 631 | 624 | wpbc_ui_settings__panel_end(); |
| 632 | 625 | |
| 633 | 626 | ?></div><?php |
| @@ -634,54 +627,18 @@ | ||
| 634 | 627 | |
| 635 | 628 | } |
| 636 | 629 | |
| 637 | 630 | /** |
| 638 | - * Show == Dashboard Card - Booking Form Fields == | |
| 631 | + * Show == Dashboard Card - Booking Form Builder == | |
| 639 | 632 | * |
| 640 | 633 | * @return void |
| 641 | 634 | */ |
| 642 | - function wpbc_ui_settings_panel__card__form_fields( $params = array() ){ | |
| 643 | - | |
| 644 | - $onclick = '';// ' onclick="' . "javascript:wpbc_navigation_click_show_section(this,'#wpbc_general_settings_calendar_metabox' );" . '" '; | |
| 645 | - $url = ' href="' . esc_url( wpbc_get_settings_url() . '&tab=form' ) . '" '; | |
| 646 | - | |
| 647 | - ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__form_fields"> | |
| 648 | - <div class="wpbc_ui_settings__text_row"> | |
| 649 | - <i class="menu_icon icon-1x wpbc_icn_dashboard"></i> | |
| 650 | - <h1> | |
| 651 | - <a onclick="<?php | |
| 652 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 653 | - echo $onclick; ?>" <?php | |
| 654 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 655 | - echo $url; ?>> | |
| 656 | - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html__('Booking Form Fields','booking'); ?></span> | |
| 657 | - </a> | |
| 658 | - </h1> | |
| 659 | - </div> | |
| 660 | - <div class="wpbc_ui_settings__text_row"> | |
| 661 | - <a class="wpbc_ui_settings__text_color__black" onclick="<?php | |
| 662 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 663 | - echo $onclick; ?>" <?php | |
| 664 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 665 | - echo $url; ?>> <?php esc_html_e( 'Add, remove, or customize fields in your booking form.', 'booking' ); ?> | |
| 666 | - </a> | |
| 667 | - </div> | |
| 668 | - </div><?php | |
| 669 | - | |
| 670 | - } | |
| 671 | - | |
| 672 | - | |
| 673 | - /** | |
| 674 | - * Show == Dashboard Card - Booking Form Fields == | |
| 675 | - * | |
| 676 | - * @return void | |
| 677 | - */ | |
| 678 | 635 | function wpbc_ui_settings_panel__card__bfb( $params = array() ){ |
| 679 | 636 | |
| 680 | 637 | $onclick = '';// ' onclick="' . "javascript:wpbc_navigation_click_show_section(this,'#wpbc_general_settings_calendar_metabox' );" . '" '; |
| 681 | 638 | $url = ' href="' . esc_url( wpbc_get_settings_url() . '&tab=builder_booking_form' ) . '" '; |
| 682 | 639 | |
| 683 | - ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__form_fields"> | |
| 640 | + ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__bfb"> | |
| 684 | 641 | <div class="wpbc_ui_settings__text_row"> |
| 685 | 642 | <i class="menu_icon icon-1x wpbc_icn_dashboard"></i> |
| 686 | 643 | <h1> |
| 687 | 644 | <a onclick="<?php |
| @@ -704,131 +661,8 @@ | ||
| 704 | 661 | </div><?php |
| 705 | 662 | |
| 706 | 663 | } |
| 707 | 664 | |
| 708 | - /** | |
| 709 | - * Show == Dashboard Card - Time Fields == | |
| 710 | - * | |
| 711 | - * @return void | |
| 712 | - */ | |
| 713 | - function wpbc_ui_settings_panel__card__time_fields( $params = array() ){ | |
| 714 | - | |
| 715 | - $onclick = '';// ' onclick="' . "javascript:wpbc_navigation_click_show_section(this,'#wpbc_general_settings_calendar_metabox' );" . '" '; | |
| 716 | - $url = ' href="' . esc_url( wpbc_get_settings_url() . '&tab=form&field_type=timeslots' ) . '" '; | |
| 717 | - | |
| 718 | - ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__time_fields"> | |
| 719 | - <div class="wpbc_ui_settings__text_row"> | |
| 720 | - <i class="menu_icon icon-1x wpbc_icn_schedule"></i> | |
| 721 | - <h1> | |
| 722 | - <a onclick="<?php | |
| 723 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 724 | - echo $onclick; ?>" <?php | |
| 725 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 726 | - echo $url; ?>> | |
| 727 | - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html__('Time Slot Configuration','booking'); ?></span> | |
| 728 | - </a> | |
| 729 | - </h1> | |
| 730 | - </div> | |
| 731 | - <div class="wpbc_ui_settings__text_row"> | |
| 732 | - <a class="wpbc_ui_settings__text_color__black" onclick="<?php | |
| 733 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 734 | - echo $onclick; ?>" <?php | |
| 735 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 736 | - echo $url; ?>> <?php esc_html_e( 'Enable and configure time selection fields in your booking form.', 'booking' ); ?> | |
| 737 | - </a> | |
| 738 | - </div> | |
| 739 | - </div><?php | |
| 740 | - | |
| 741 | - } | |
| 742 | - | |
| 743 | - | |
| 744 | - /** | |
| 745 | - * Show == Dashboard Card - Form Options == | |
| 746 | - * | |
| 747 | - * @return void | |
| 748 | - */ | |
| 749 | - function wpbc_ui_settings_panel__card__form_options( $params = array() ){ | |
| 750 | - | |
| 751 | - $title = esc_attr__( 'Booking Form Options', 'booking' ); | |
| 752 | - | |
| 753 | - if ( ! empty( $params['is_use_permalink'] ) ) { | |
| 754 | - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_form_tab'; | |
| 755 | - $onclick = ''; | |
| 756 | - } else { | |
| 757 | - $permalink = 'javascript:void(0);'; | |
| 758 | - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_form_tab a' ,'#wpbc_general_settings_form_metabox', '" . $title . "' );"; | |
| 759 | - } | |
| 760 | - $onclick = ''; | |
| 761 | - $permalink = wpbc_get_settings_url() . '&tab=form&subtab=form_options'; | |
| 762 | - | |
| 763 | - ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__form_options"> | |
| 764 | - <div class="wpbc_ui_settings__text_row"> | |
| 765 | - <i class="menu_icon icon-1x wpbc-bi-toggle2-off"></i> | |
| 766 | - <h1> | |
| 767 | - <a onclick="<?php | |
| 768 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 769 | - echo $onclick; ?>" href="<?php | |
| 770 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 771 | - echo $permalink; ?>"> | |
| 772 | - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html( $title ); ?></span> | |
| 773 | - </a> | |
| 774 | - </h1> | |
| 775 | - </div> | |
| 776 | - <div class="wpbc_ui_settings__text_row"> | |
| 777 | - <a class="wpbc_ui_settings__text_color__black" onclick="<?php | |
| 778 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 779 | - echo $onclick; ?>" href="<?php | |
| 780 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 781 | - echo $permalink; ?>"> | |
| 782 | - <?php esc_html_e( 'Enable CAPTCHA, auto-fill fields, and customize the form\'s color theme.', 'booking' ); ?> | |
| 783 | - </a> | |
| 784 | - </div> | |
| 785 | - </div><?php | |
| 786 | - } | |
| 787 | - | |
| 788 | - /** | |
| 789 | - * Show == Dashboard Card - Time Slots Options == | |
| 790 | - * | |
| 791 | - * @return void | |
| 792 | - */ | |
| 793 | - function wpbc_ui_settings_panel__card__time_slots_options( $params = array() ){ | |
| 794 | - | |
| 795 | - $title = esc_attr__( 'Time Slot Appearance', 'booking' ); | |
| 796 | - | |
| 797 | - if ( ! empty( $params['is_use_permalink'] ) ) { | |
| 798 | - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_time_slots_tab'; | |
| 799 | - $onclick = ''; | |
| 800 | - } else { | |
| 801 | - $permalink = 'javascript:void(0);'; | |
| 802 | - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_time_slots_tab a' ,'#wpbc_general_settings_time_slots_metabox', '" . $title . "' );"; | |
| 803 | - } | |
| 804 | - $permalink = function_exists( 'wpbc_get_settings_themes_url' ) ? wpbc_get_settings_themes_url() : wpbc_get_settings_url() . '&tab=themes'; | |
| 805 | - $onclick = ''; | |
| 806 | - | |
| 807 | - ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__time_slots_options"> | |
| 808 | - <div class="wpbc_ui_settings__text_row"> | |
| 809 | - <i class="menu_icon icon-1x wpbc_icn_more_time"></i> | |
| 810 | - <h1> | |
| 811 | - <a onclick="<?php | |
| 812 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 813 | - echo $onclick; ?>" href="<?php | |
| 814 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 815 | - echo $permalink; ?>"> | |
| 816 | - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html( $title ); ?></span> | |
| 817 | - </a> | |
| 818 | - </h1> | |
| 819 | - </div> | |
| 820 | - <div class="wpbc_ui_settings__text_row"> | |
| 821 | - <a class="wpbc_ui_settings__text_color__black" onclick="<?php | |
| 822 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 823 | - echo $onclick; ?>" href="<?php | |
| 824 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 825 | - echo $permalink; ?>"> <?php esc_html_e( 'Choose how time slots are shown in the form: as a dropdown list or a time picker, and set a color theme.', 'booking' ); ?> | |
| 826 | - </a> | |
| 827 | - </div> | |
| 828 | - </div><?php | |
| 829 | - } | |
| 830 | - | |
| 831 | 665 | // --------------------------------------------------------------------------------------------------------------------- |
| 832 | 666 | |
| 833 | 667 | /** |
| 834 | 668 | * Show Settings = Booking Confirmation = Panel |
| @@ -2084,22 +1918,61 @@ | ||
| 2084 | 1918 | </div> |
| 2085 | 1919 | <?php |
| 2086 | 1920 | } |
| 2087 | 1921 | |
| 2088 | - function wpbc_ui_settings_panel__card__setup_wizard() { | |
| 2089 | - ?> | |
| 2090 | - <div class="wpbc_ui_settings__card wpbc_ui_settings__card_divider_right"> | |
| 2091 | - <div class="wpbc_ui_settings__center wpbc_container wpbc_container_booking_form"> | |
| 2092 | - <a class="wpbc_button_light button-primary wpbc_button_green tooltip_top" style="padding: 12px 24px;" | |
| 2093 | - title="<?php echo esc_attr( sprintf( __('We\'ll guide you through the steps to set up WP Booking Calendar on your site.','booking'), '<strong>WP Booking Calendar</strong>' ) ); ?>" | |
| 2094 | - href="<?php echo esc_url( wpbc_get_settings_url() . '&wpbc_setup_wizard=reset&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) ); ?>"><?php | |
| 2095 | - esc_html_e( 'Start Setup Wizard', 'booking' ) | |
| 2096 | - ?></a> | |
| 1922 | + /** | |
| 1923 | + * Render the administration card that opens the Setup Wizard. | |
| 1924 | + * | |
| 1925 | + * @return void | |
| 1926 | + */ | |
| 1927 | + function wpbc_ui_settings_panel__card__setup_wizard() { | |
| 1928 | + ?> | |
| 1929 | + <div class="wpbc_ui_settings__card wpbc_ui_settings__card_divider_right"> | |
| 1930 | + <div class="wpbc_ui_settings__center"> | |
| 1931 | + <a class="wpbc_admin_button wpbc_admin_button--success tooltip_top" | |
| 1932 | + title="<?php echo esc_attr( sprintf( __('We\'ll guide you through the steps to set up WP Booking Calendar on your site.','booking'), '<strong>WP Booking Calendar</strong>' ) ); ?>" | |
| 1933 | + href="<?php echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>"><?php | |
| 1934 | + esc_html_e( 'Start Setup Wizard', 'booking' ) | |
| 1935 | + ?></a> | |
| 2097 | 1936 | </div> |
| 2098 | 1937 | </div> |
| 2099 | 1938 | <?php |
| 2100 | 1939 | } |
| 2101 | 1940 | |
| 1941 | + | |
| 1942 | + /** | |
| 1943 | + * Show the starter-page testing action. | |
| 1944 | + * | |
| 1945 | + * The manual starter-page action is intentionally available only on a site | |
| 1946 | + * retained as a genuine first installation with at least one currently valid | |
| 1947 | + * starter page. It reopens the dialog without changing its automatic prompt | |
| 1948 | + * state and never creates or repairs a missing page. | |
| 1949 | + * | |
| 1950 | + * @return void | |
| 1951 | + */ | |
| 1952 | + function wpbc_ui_settings_panel__card__open_test_pages_popup() { | |
| 1953 | + | |
| 1954 | + $can_open_booking_pages = class_exists( 'WPBC_Setup_Wizard_Booking_Pages' ) && WPBC_Setup_Wizard_Booking_Pages::can_manually_open_booking_pages_dialog(); | |
| 1955 | + | |
| 1956 | + if ( $can_open_booking_pages ) : | |
| 1957 | + ?> | |
| 1958 | + <div class="wpbc_ui_settings__card wpbc_ui_settings__card_divider_right"> | |
| 1959 | + <div class="wpbc_ui_settings__center"> | |
| 1960 | + <button | |
| 1961 | + type="button" | |
| 1962 | + class="wpbc_admin_button wpbc_admin_button--primary" | |
| 1963 | + data-wpbc-booking-pages-open-dialog="1" | |
| 1964 | + > | |
| 1965 | + <?php | |
| 1966 | + esc_html_e( 'Test your booking pages', 'booking' ); ?> | |
| 1967 | + </button> | |
| 1968 | + </div> | |
| 1969 | + </div> | |
| 1970 | + <?php | |
| 1971 | + endif; | |
| 1972 | + | |
| 1973 | + } | |
| 1974 | + | |
| 2102 | 1975 | function wpbc_ui_settings_panel__card__transaltion_download() { |
| 2103 | 1976 | ?> |
| 2104 | 1977 | <div class="wpbc_ui_settings__card wpbc_ui_settings__card_divider_right"> |
| 2105 | 1978 | <div class="wpbc_ui_settings__center"> |
| @@ -2133,9 +2006,11 @@ | ||
| 2133 | 2006 | |
| 2134 | 2007 | /** |
| 2135 | 2008 | * Show Version card in top panel |
| 2136 | 2009 | * |
| 2137 | - * @return void | |
| 2010 | + * @param array $params_btn Optional version-card presentation parameters. | |
| 2011 | + * | |
| 2012 | + * @return void | |
| 2138 | 2013 | */ |
| 2139 | 2014 | function wpbc_ui_settings_panel__card__version( $params_btn = array() ){ |
| 2140 | 2015 | |
| 2141 | 2016 | $defaults = array( |
| @@ -2178,15 +2053,15 @@ | ||
| 2178 | 2053 | echo $version_title |
| 2179 | 2054 | ?></a> |
| 2180 | 2055 | </div> |
| 2181 | 2056 | |
| 2182 | - <?php if ( $params_btn['is_show_wizard_button'] ) { ?> | |
| 2183 | - <div class="wpbc_ui_settings__center wpbc_container wpbc_container_booking_form" style="flex: 1 1 auto;"> | |
| 2184 | - <a class="wpbc_button_light button-primary wpbc_button_green tooltip_top" style="padding: 12px 24px;" | |
| 2185 | - title="<?php echo esc_attr( sprintf( __('We\'ll guide you through the steps to set up WP Booking Calendar on your site.','booking'), '<strong>WP Booking Calendar</strong>' ) ); ?>" | |
| 2186 | - href="<?php echo esc_url( wpbc_get_settings_url() . '&wpbc_setup_wizard=reset&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) ); ?>"><?php | |
| 2187 | - esc_html_e( 'Start Setup Wizard', 'booking' ) | |
| 2188 | - ?></a> | |
| 2057 | + <?php if ( $params_btn['is_show_wizard_button'] ) { ?> | |
| 2058 | + <div class="wpbc_ui_settings__center" style="flex: 1 1 auto;"> | |
| 2059 | + <a class="wpbc_admin_button wpbc_admin_button--success tooltip_top" | |
| 2060 | + title="<?php echo esc_attr( sprintf( __('We\'ll guide you through the steps to set up WP Booking Calendar on your site.','booking'), '<strong>WP Booking Calendar</strong>' ) ); ?>" | |
| 2061 | + href="<?php echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>"><?php | |
| 2062 | + esc_html_e( 'Start Setup Wizard', 'booking' ) | |
| 2063 | + ?></a> | |
| 2189 | 2064 | </div> |
| 2190 | 2065 | <?php } ?> |
| 2191 | 2066 | </div><?php |
| 2192 | 2067 | } |