PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
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 10.11 All 204 releases
← All changes | includes/_toolbar_ui/ui__settings_panel.php +153 -199 10.1111.8.4 View file →
@@ -1,4 +1,4 @@
1 1 <?php /**
2 2 * @version 1.0
3 3 * @package Booking Calendar
4 4 * @category UI Elements for Settings
@@ -103,27 +103,71 @@
103 103
104 104 /**
105 105 * Top Path Line
106 106 *
107 + * @param WPBC_Page_Structure|false $page_structure_obj Page structure object.
108 + *
107 109 * @return void
108 110 */
109 -function wpbc_ui_settings__top_path() {
111 +function wpbc_ui_settings__top_path( $page_structure_obj = false ) {
110 112
113 + $items = array();
114 + $is_show_version = true;
115 +
116 + if ( is_object( $page_structure_obj ) && method_exists( $page_structure_obj, 'get_top_path_items' ) ) {
117 + $items = $page_structure_obj->get_top_path_items();
118 + }
119 +
120 + if ( is_object( $page_structure_obj ) && method_exists( $page_structure_obj, 'is_top_path_show_version' ) ) {
121 + $is_show_version = $page_structure_obj->is_top_path_show_version();
122 + }
123 +
124 + if ( empty( $items ) ) {
125 + $items = array(
126 + array(
127 + 'title' => __( 'WP Booking Calendar', 'booking' ),
128 + 'url' => function_exists( 'wpbc_get_bookings_url' ) ? wpbc_get_bookings_url() : admin_url( 'admin.php?page=wpbc' ),
129 + 'onclick' => '',
130 + 'active' => false,
131 + ),
132 + array(
133 + 'title' => __( 'Settings', 'booking' ),
134 + 'onclick' => "wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '" . esc_attr__( 'Dashboard', 'booking' ) . "' );",
135 + 'url' => '',
136 + 'active' => false,
137 + ),
138 + array(
139 + 'title' => __( 'Dashboard', 'booking' ),
140 + 'onclick' => "wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '" . esc_attr__( 'Dashboard', 'booking' ) . "' );",
141 + 'url' => '',
142 + 'active' => true,
143 + ),
144 + );
145 + }
146 +
111 147 ?>
112 148 <div class="wpbc_settings_path">
113 149 <?php /* ?><div class="wpbc_settings_path_el" style="border: 1px solid #d0d0d0;margin-right: 15px;border-radius: 50%;aspect-ratio: 1 / 1;text-align: center;display: none;"> <a><i class="menu_icon icon-1x wpbc_icn_navigate_before"></i></a></div><?php */ ?>
114 - <div class="wpbc_settings_path_el">
115 - <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_attr__( 'Dashboard', 'booking' ); ?>' );" href="javascript:void(0);"><?php
116 - esc_html_e('Settings', 'booking');
117 - ?></a>
118 - </div>
119 - <div class="wpbc_settings_path_el"><i class="menu_icon icon-1x wpbc_icn_navigate_next"></i></div>
120 - <div class="wpbc_settings_path_el wpbc_settings_path_el_active">
121 - <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_attr__( 'Dashboard', 'booking' ); ?>' );" href="javascript:void(0);"><?php
122 - esc_html_e('Dashboard', 'booking');
123 - ?></a>
124 - </div>
125 - <?php wpbc_ui_settings_panel__top_path__version(); ?>
150 + <?php foreach ( $items as $item_index => $item ) : ?>
151 + <?php if ( 0 < $item_index ) : ?>
152 + <div class="wpbc_settings_path_el"><i class="menu_icon icon-1x wpbc_icn_navigate_next"></i></div>
153 + <?php endif; ?>
154 + <div class="wpbc_settings_path_el<?php echo ( ! empty( $item['active'] ) ) ? ' wpbc_settings_path_el_active' : ''; ?>">
155 + <a
156 + <?php if ( ! empty( $item['onclick'] ) ) : ?>
157 + onclick="javascript:<?php echo $item['onclick']; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>"
158 + href="javascript:void(0);"
159 + <?php else : ?>
160 + href="<?php echo esc_url( ! empty( $item['url'] ) ? $item['url'] : '#' ); ?>"
161 + <?php endif; ?>
162 + ><?php echo esc_html( $item['title'] ); ?></a>
163 + </div>
164 + <?php endforeach; ?>
165 + <?php
166 + if ( $is_show_version ) {
167 + wpbc_ui_settings_panel__top_path__version();
168 + }
169 + ?>
126 170 </div>
127 171 <?php
128 172 }
129 173
@@ -319,13 +363,13 @@
319 363
320 364 $title = esc_attr__( 'Calendar Settings', 'booking' );
321 365
322 366 if ( ! empty( $params['is_use_permalink'] ) ) {
323 - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_calendar_tab';
367 + $permalink = function_exists( 'wpbc_get_settings_calendar_url' ) ? wpbc_get_settings_calendar_url() : wpbc_get_settings_url() . '&tab=calendar_settings';
324 368 $onclick = "";
325 369 } else {
326 - $permalink = 'javascript:void(0);';
327 - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_calendar_tab a' ,'#wpbc_general_settings_calendar_metabox', '" . $title . "' );";
370 + $permalink = function_exists( 'wpbc_get_settings_calendar_url' ) ? wpbc_get_settings_calendar_url() : wpbc_get_settings_url() . '&tab=calendar_settings';
371 + $onclick = "";
328 372 }
329 373
330 374 ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__calendar">
331 375 <div class="wpbc_ui_settings__text_row">
@@ -361,14 +405,13 @@
361 405 function wpbc_ui_settings_panel__card__days_selection( $params = array() ){
362 406
363 407 $title = esc_attr__( 'Days Selection', 'booking' );
364 408 if ( ! empty( $params['is_use_permalink'] ) ) {
365 - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_calendar_tab';
409 + $permalink = function_exists( 'wpbc_get_settings_calendar_url' ) ? wpbc_get_settings_calendar_url() : wpbc_get_settings_url() . '&tab=calendar_settings';
366 410 $onclick = "";
367 411 } else {
368 - $permalink = 'javascript:void(0);';
369 - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_calendar_tab a' ,'#wpbc_general_settings_calendar_metabox', '" . $title . "' );";
370 - $onclick .= "wpbc_blink_element('.wpbc_tr_set_gen_booking_type_of_day_selections', 4, 350); ";
412 + $permalink = function_exists( 'wpbc_get_settings_calendar_url' ) ? wpbc_get_settings_calendar_url() : wpbc_get_settings_url() . '&tab=calendar_settings';
413 + $onclick = "";
371 414 }
372 415
373 416 ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__days_selection">
374 417 <div class="wpbc_ui_settings__text_row">
@@ -387,9 +430,9 @@
387 430 <a class="wpbc_ui_settings__text_color__black" onclick="<?php
388 431 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
389 432 echo $onclick; ?>" href="<?php
390 433 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
391 - 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' ); ?>
392 435 </a>
393 436 </div>
394 437 </div><?php
395 438
@@ -408,20 +451,13 @@
408 451
409 452 $title = esc_attr__( 'Changeover Days', 'booking' );
410 453
411 454 if ( class_exists( 'wpdev_bk_biz_s' ) ) {
412 - $onclick = ' onclick="';
413 - $onclick .= "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_calendar_tab a' ,'#wpbc_general_settings_calendar_metabox', '" . $title . "' );";
414 - //$onclick .= " jQuery( '#type_of_day_selections_range').prop('checked',true).trigger('change'); "; // Enable Range Days selection
415 - //$onclick .= " jQuery( '#range_selection_type_dynamic').prop('checked',true).trigger('change'); "; // Enable Range Days selection
416 - $onclick .= " wpbc_blink_element('.wpbc_tr_set_gen_booking_range_selection_time_is_active', 4, 350); ";
417 - $onclick .= " wpbc_scroll_to('.wpbc_tr_set_gen_booking_range_selection_time_is_active' ); ";
418 - $onclick .= '" ';
455 + $onclick = '';
456 + $url = ' href="' . esc_url( function_exists( 'wpbc_get_settings_calendar_url' ) ? wpbc_get_settings_calendar_url() : wpbc_get_settings_url() . '&tab=calendar_settings' ) . '" ';
419 457
420 - $url = ' href="javascript:void(0);" ';
421 -
422 458 if ( ! empty( $params['is_use_permalink'] ) ) {
423 - $url = ' href="'. esc_url( wpbc_get_settings_url() ) . '&scroll_to_section=wpbc_general_settings_calendar_tab" '; // Direct link
459 + $url = ' href="'. esc_url( function_exists( 'wpbc_get_settings_calendar_url' ) ? wpbc_get_settings_calendar_url() : wpbc_get_settings_url() . '&tab=calendar_settings' ) . '" '; // Direct link
424 460 $onclick = "";
425 461 }
426 462
427 463 } else {
@@ -466,17 +502,13 @@
466 502 */
467 503 function wpbc_ui_settings_panel__card__tooltips_in_days( $params = array() ){
468 504
469 505 $title = esc_attr__( 'Day Tooltips', 'booking' );
506 + $permalink = function_exists( 'wpbc_settings_calendar__get_section_url' )
507 + ? wpbc_settings_calendar__get_section_url( 'tooltips' )
508 + : wpbc_get_settings_url() . '&tab=calendar_settings&wpbc_calendar_section=tooltips';
509 + $onclick = "";
470 510
471 - if ( ! empty( $params['is_use_permalink'] ) ) {
472 - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_days_tooltips_tab';
473 - $onclick = "";
474 - } else {
475 - $permalink = 'javascript:void(0);';
476 - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_days_tooltips_tab a' ,'#wpbc_general_settings_days_tooltips_metabox', '" . $title . "' );";
477 - }
478 -
479 511 ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__tooltips_in_days">
480 512 <div class="wpbc_ui_settings__text_row">
481 513 <i class="menu_icon icon-1x wpbc-bi-chat-square-dots"></i>
482 514 <h1>
@@ -507,17 +539,12 @@
507 539 * @return void
508 540 */
509 541 function wpbc_ui_settings_panel__card__general_availability( $params = array() ){
510 542
511 - $title = esc_attr__( 'General Availability', 'booking' );
543 + $title = esc_attr__( 'Schedule & Rules', 'booking' );
512 544
513 - if ( ! empty( $params['is_use_permalink'] ) ) {
514 - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_availability_tab';
515 - $onclick = "";
516 - } else {
517 - $permalink = 'javascript:void(0);';
518 - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_availability_tab a' ,'#wpbc_general_settings_availability_metabox', '" . $title . "' );";
519 - }
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 + $onclick = "";
520 547
521 548 ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__general_availability">
522 549 <div class="wpbc_ui_settings__text_row">
523 550 <i class="menu_icon icon-1x wpbc-bi-calendar-check bi-calendar2-day"></i>
@@ -550,17 +577,11 @@
550 577 */
551 578 function wpbc_ui_settings_panel__card__capacity( $params = array() ){
552 579
553 580 $title = esc_attr__( 'Booking Capacity', 'booking' );
581 + $permalink = function_exists( 'wpbc_get_resource_capacity_url' ) ? wpbc_get_resource_capacity_url() : wpbc_get_resources_url() . '&tab=capacity';
582 + $onclick = "";
554 583
555 - if ( ! empty( $params['is_use_permalink'] ) ) {
556 - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_capacity_tab';
557 - $onclick = "";
558 - } else {
559 - $permalink = 'javascript:void(0);';
560 - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_capacity_tab a' ,'#wpbc_general_settings_capacity_metabox,#wpbc_general_settings_capacity_upgrade_metabox', '" . $title . "' );";
561 - }
562 -
563 584 ?><div class="wpbc_ui_settings__card wpbc_ui_settings__card_text_small wpbc_ui_settings__card_divider_right wpbc_ui_settings_panel__card__capacity">
564 585 <div class="wpbc_ui_settings__text_row">
565 586 <i class="menu_icon icon-1x wpbc_icn_filter_none"></i>
566 587 <h1>
@@ -597,12 +618,9 @@
597 618 ?><div class="wpbc_ui_settings__flex_container wpbc_ui_settings__panel__form"><?php
598 619
599 620 wpbc_ui_settings__panel_start();
600 621
601 - wpbc_ui_settings_panel__card__form_fields( $params );
602 - wpbc_ui_settings_panel__card__time_fields( $params );
603 - wpbc_ui_settings_panel__card__time_slots_options( $params );
604 - wpbc_ui_settings_panel__card__form_options( $params );
622 + wpbc_ui_settings_panel__card__bfb( $params );
605 623
606 624 wpbc_ui_settings__panel_end();
607 625
608 626 ?></div><?php
@@ -609,18 +627,18 @@
609 627
610 628 }
611 629
612 630 /**
613 - * Show == Dashboard Card - Booking Form Fields ==
631 + * Show == Dashboard Card - Booking Form Builder ==
614 632 *
615 633 * @return void
616 634 */
617 - function wpbc_ui_settings_panel__card__form_fields( $params = array() ){
635 + function wpbc_ui_settings_panel__card__bfb( $params = array() ){
618 636
619 637 $onclick = '';// ' onclick="' . "javascript:wpbc_navigation_click_show_section(this,'#wpbc_general_settings_calendar_metabox' );" . '" ';
620 - $url = ' href="' . esc_url( wpbc_get_settings_url() . '&tab=form' ) . '" ';
638 + $url = ' href="' . esc_url( wpbc_get_settings_url() . '&tab=builder_booking_form' ) . '" ';
621 639
622 - ?><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">
623 641 <div class="wpbc_ui_settings__text_row">
624 642 <i class="menu_icon icon-1x wpbc_icn_dashboard"></i>
625 643 <h1>
626 644 <a onclick="<?php
@@ -627,9 +645,9 @@
627 645 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
628 646 echo $onclick; ?>" <?php
629 647 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
630 648 echo $url; ?>>
631 - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html__('Booking Form Fields','booking'); ?></span>
649 + <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html__('Drag & Drop Booking Form Builder','booking'); ?></span>
632 650 </a>
633 651 </h1>
634 652 </div>
635 653 <div class="wpbc_ui_settings__text_row">
@@ -643,131 +661,8 @@
643 661 </div><?php
644 662
645 663 }
646 664
647 - /**
648 - * Show == Dashboard Card - Time Fields ==
649 - *
650 - * @return void
651 - */
652 - function wpbc_ui_settings_panel__card__time_fields( $params = array() ){
653 -
654 - $onclick = '';// ' onclick="' . "javascript:wpbc_navigation_click_show_section(this,'#wpbc_general_settings_calendar_metabox' );" . '" ';
655 - $url = ' href="' . esc_url( wpbc_get_settings_url() . '&tab=form&field_type=timeslots' ) . '" ';
656 -
657 - ?><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">
658 - <div class="wpbc_ui_settings__text_row">
659 - <i class="menu_icon icon-1x wpbc_icn_schedule"></i>
660 - <h1>
661 - <a onclick="<?php
662 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
663 - echo $onclick; ?>" <?php
664 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
665 - echo $url; ?>>
666 - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html__('Time Slot Configuration','booking'); ?></span>
667 - </a>
668 - </h1>
669 - </div>
670 - <div class="wpbc_ui_settings__text_row">
671 - <a class="wpbc_ui_settings__text_color__black" onclick="<?php
672 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
673 - echo $onclick; ?>" <?php
674 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
675 - echo $url; ?>> <?php esc_html_e( 'Enable and configure time selection fields in your booking form.', 'booking' ); ?>
676 - </a>
677 - </div>
678 - </div><?php
679 -
680 - }
681 -
682 -
683 - /**
684 - * Show == Dashboard Card - Form Options ==
685 - *
686 - * @return void
687 - */
688 - function wpbc_ui_settings_panel__card__form_options( $params = array() ){
689 -
690 - $title = esc_attr__( 'Booking Form Options', 'booking' );
691 -
692 - if ( ! empty( $params['is_use_permalink'] ) ) {
693 - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_form_tab';
694 - $onclick = '';
695 - } else {
696 - $permalink = 'javascript:void(0);';
697 - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_form_tab a' ,'#wpbc_general_settings_form_metabox', '" . $title . "' );";
698 - }
699 - $onclick = '';
700 - $permalink = wpbc_get_settings_url() . '&tab=form&subtab=form_options';
701 -
702 - ?><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">
703 - <div class="wpbc_ui_settings__text_row">
704 - <i class="menu_icon icon-1x wpbc-bi-toggle2-off"></i>
705 - <h1>
706 - <a onclick="<?php
707 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
708 - echo $onclick; ?>" href="<?php
709 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
710 - echo $permalink; ?>">
711 - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html( $title ); ?></span>
712 - </a>
713 - </h1>
714 - </div>
715 - <div class="wpbc_ui_settings__text_row">
716 - <a class="wpbc_ui_settings__text_color__black" onclick="<?php
717 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
718 - echo $onclick; ?>" href="<?php
719 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
720 - echo $permalink; ?>">
721 - <?php esc_html_e( 'Enable CAPTCHA, auto-fill fields, and customize the form\'s color theme.', 'booking' ); ?>
722 - </a>
723 - </div>
724 - </div><?php
725 - }
726 -
727 - /**
728 - * Show == Dashboard Card - Time Slots Options ==
729 - *
730 - * @return void
731 - */
732 - function wpbc_ui_settings_panel__card__time_slots_options( $params = array() ){
733 -
734 - $title = esc_attr__( 'Time Slot Appearance', 'booking' );
735 -
736 - if ( ! empty( $params['is_use_permalink'] ) ) {
737 - $permalink = wpbc_get_settings_url() . '&scroll_to_section=wpbc_general_settings_time_slots_tab';
738 - $onclick = '';
739 - } else {
740 - $permalink = 'javascript:void(0);';
741 - $onclick = "javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_time_slots_tab a' ,'#wpbc_general_settings_time_slots_metabox', '" . $title . "' );";
742 - }
743 - $permalink = wpbc_get_settings_url() . '&tab=color_themes';
744 - $onclick = '';
745 -
746 - ?><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">
747 - <div class="wpbc_ui_settings__text_row">
748 - <i class="menu_icon icon-1x wpbc_icn_more_time"></i>
749 - <h1>
750 - <a onclick="<?php
751 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
752 - echo $onclick; ?>" href="<?php
753 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
754 - echo $permalink; ?>">
755 - <span class="0wpbc_ui_settings__text_color__black2"><?php echo esc_html( $title ); ?></span>
756 - </a>
757 - </h1>
758 - </div>
759 - <div class="wpbc_ui_settings__text_row">
760 - <a class="wpbc_ui_settings__text_color__black" onclick="<?php
761 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
762 - echo $onclick; ?>" href="<?php
763 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
764 - 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' ); ?>
765 - </a>
766 - </div>
767 - </div><?php
768 - }
769 -
770 665 // ---------------------------------------------------------------------------------------------------------------------
771 666
772 667 /**
773 668 * Show Settings = Booking Confirmation = Panel
@@ -2023,15 +1918,20 @@
2023 1918 </div>
2024 1919 <?php
2025 1920 }
2026 1921
2027 - function wpbc_ui_settings_panel__card__setup_wizard() {
2028 - ?>
2029 - <div class="wpbc_ui_settings__card wpbc_ui_settings__card_divider_right">
2030 - <div class="wpbc_ui_settings__center wpbc_container wpbc_container_booking_form">
2031 - <a class="wpbc_button_light button-primary wpbc_button_green tooltip_top" style="padding: 12px 24px;"
2032 - 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>' ) ); ?>"
2033 - href="<?php echo esc_url( wpbc_get_settings_url() . '&wpbc_setup_wizard=reset&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) ); ?>"><?php
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_settings_url() . '&wpbc_setup_wizard=reset&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) ); ?>"><?php
2034 1934 esc_html_e( 'Start Setup Wizard', 'booking' )
2035 1935 ?></a>
2036 1936 </div>
2037 1937 </div>
@@ -2037,8 +1937,42 @@
2037 1937 </div>
2038 1938 <?php
2039 1939 }
2040 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_First_Run_Popup' ) && WPBC_Setup_Wizard_First_Run_Popup::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 +
2041 1975 function wpbc_ui_settings_panel__card__transaltion_download() {
2042 1976 ?>
2043 1977 <div class="wpbc_ui_settings__card wpbc_ui_settings__card_divider_right">
2044 1978 <div class="wpbc_ui_settings__center">
@@ -2072,13 +2006,20 @@
2072 2006
2073 2007 /**
2074 2008 * Show Version card in top panel
2075 2009 *
2076 - * @return void
2010 + * @param array $params_btn Optional version-card presentation parameters.
2011 + *
2012 + * @return void
2077 2013 */
2078 - function wpbc_ui_settings_panel__card__version(){
2079 - // Version ---------------------------------------------------------------------------------------------------------
2014 + function wpbc_ui_settings_panel__card__version( $params_btn = array() ){
2080 2015
2016 + $defaults = array(
2017 + 'is_show_wizard_button' => false,
2018 + );
2019 + $params_btn = wp_parse_args( $params_btn, $defaults );
2020 +
2021 + // Version.
2081 2022 $version_title = '';
2082 2023
2083 2024 if ( class_exists( 'wpdev_bk_personal' ) ) {
2084 2025 $version_title .= wpbc_dashboard_info_get_version_type_readable();
@@ -2111,8 +2052,18 @@
2111 2052 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2112 2053 echo $version_title
2113 2054 ?></a>
2114 2055 </div>
2056 +
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_settings_url() . '&wpbc_setup_wizard=reset&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) ); ?>"><?php
2062 + esc_html_e( 'Start Setup Wizard', 'booking' )
2063 + ?></a>
2064 + </div>
2065 + <?php } ?>
2115 2066 </div><?php
2116 2067 }
2117 2068
2118 2069 /**
@@ -2145,9 +2096,12 @@
2145 2096 <div class="wpbc_settings_path_el wpbc_ui_settings__flex_container" style="margin-left:auto;flex-flow: row nowrap;">
2146 2097 <a class="" href="https://wpbookingcalendar.com/changelog/#<?php
2147 2098 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2148 2099 echo wpbc_get_slug_format( trim( wpbc_dashboard_info_get_version_type_readable() . '_' . wpbc_dashboard_info_get_version_type_sites() . '_' . esc_attr( WP_BK_VERSION_NUM ) ) ); ?>">
2149 - <span class="wpbc_ui_settings__text_color__green"><i class="menu_icon icon-1x wpbc_icn_numbers -bi-balloon-heart bi-activity"></i> <?php echo esc_attr( WP_BK_VERSION_NUM ); ?></span>
2100 + <span class="wpbc_ui_settings__text_color__green"><i class="menu_icon icon-1x wpbc_icn_numbers -bi-balloon-heart bi-activity"></i> <?php
2101 + // echo esc_attr( WP_BK_VERSION_NUM );
2102 + echo esc_attr( wpbc_get_wpbc_versions_numbers() );
2103 + ?></span>
2150 2104 </a>
2151 2105 <a class="wpbc_ui_settings__text_color__purple2" style="margin-left:1em;"
2152 2106 href="https://wpbookingcalendar.com/faq/difference-single-developer-multi-site/#<?php
2153 2107 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
@@ -2372,5 +2326,5 @@
2372 2326
2373 2327 break;
2374 2328 }
2375 2329
2376 - }
2330 + }