| @@ -1,7 +1,20 @@ | ||
| 1 | -<?php defined( 'ABSPATH' ) || exit; ?> | |
| 1 | +<?php | |
| 2 | +defined( 'ABSPATH' ) || exit; | |
| 2 | 3 | |
| 3 | -<div class="fcal_calendar_wrap<?php echo esc_attr(isset($block) ? '_block' : ''); ?>"> | |
| 4 | +use FluentBooking\App\Models\Calendar; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * @var array $author | |
| 8 | + * @var Calendar $calendar | |
| 9 | + * @var iterable $events | |
| 10 | + * @var bool $embedded | |
| 11 | + * @var bool $hideInfo | |
| 12 | + * @var bool $block | |
| 13 | + */ | |
| 14 | +?> | |
| 15 | + | |
| 16 | +<div class="fcal_calendar_wrap<?php echo esc_attr(isset($block) ? '_block' : ''); ?> <?php echo esc_attr(isset($embedded) && $embedded ? 'fcal_booking_iframe' : ''); ?>"> | |
| 4 | 17 | <div class="fluent_booking_wrap"> |
| 5 | 18 | <?php if (!isset($hideInfo) || !$hideInfo) { ?> |
| 6 | 19 | <div class="fcal_author_header"> |
| 7 | 20 | <img src="<?php echo esc_url($author['avatar']); ?>"/> |
| @@ -14,25 +27,25 @@ | ||
| 14 | 27 | <?php } ?> |
| 15 | 28 | </div> |
| 16 | 29 | </div> |
| 17 | 30 | <?php } ?> |
| 18 | - <div class="fcal_slots_wrap"> | |
| 31 | + <div class="fcal_slots_wrap<?php echo (!isset($hideInfo) || !$hideInfo) ? '' : ' no-author-header'; ?>"> | |
| 19 | 32 | <div class="fcal_slots"> |
| 20 | 33 | <?php |
| 21 | - foreach ($events as $event): ?> | |
| 34 | + foreach ($events as $fluentBookingEvent): ?> | |
| 22 | 35 | <div class="fcal_slot"> |
| 23 | - <a data-calendar_id="<?php echo (int)$event->calendar_id; ?>" | |
| 24 | - data-event_hash="<?php echo esc_attr($event->hash); ?>" | |
| 25 | - data-event_slug="<?php echo esc_attr($event->slug); ?>" | |
| 26 | - data-event_id="<?php echo (int)$event->id; ?>" | |
| 36 | + <a data-calendar_id="<?php echo (int)$fluentBookingEvent->calendar_id; ?>" | |
| 37 | + data-event_hash="<?php echo esc_attr($fluentBookingEvent->hash); ?>" | |
| 38 | + data-event_slug="<?php echo esc_attr($fluentBookingEvent->slug); ?>" | |
| 39 | + data-event_id="<?php echo (int)$fluentBookingEvent->id; ?>" | |
| 27 | 40 | onclick="<?php echo 'faCalOpenBookingPage' . (isset($block) ? 'Block' : ''); ?>(this, event)" |
| 28 | - href="<?php echo esc_url($event->public_url); ?>" class="fcal_card fcal_event_card"> | |
| 41 | + href="<?php echo esc_url($fluentBookingEvent->public_url); ?>" class="fcal_card fcal_event_card"> | |
| 29 | 42 | <div class="fcal_slot_content"> |
| 30 | 43 | <h2> |
| 31 | - <span class="fcal_slot_color_schema" style="background: <?php echo esc_attr($event->color_schema); ?>;"></span> | |
| 32 | - <?php echo esc_html($event->title); ?> | |
| 44 | + <span class="fcal_slot_color_schema" style="background: <?php echo esc_attr($fluentBookingEvent->color_schema); ?>;"></span> | |
| 45 | + <?php echo esc_html($fluentBookingEvent->title); ?> | |
| 33 | 46 | </h2> |
| 34 | - <p class="fcal_description"><?php echo wp_kses_post($event->short_description); ?></p> | |
| 47 | + <p class="fcal_description"><?php echo esc_html($fluentBookingEvent->short_description); ?></p> | |
| 35 | 48 | <div class="fcal_slot_items_wrap"> |
| 36 | 49 | <span class="fcal_slot_duration"> |
| 37 | 50 | <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> |
| 38 | 51 | <path d="M12.8334 7C12.8334 10.22 10.22 12.8333 7.00002 12.8333C3.78002 12.8333 1.16669 10.22 1.16669 7C1.16669 3.78 3.78002 1.16666 7.00002 1.16666C10.22 1.16666 12.8334 3.78 12.8334 7Z" stroke="#445164" stroke-linecap="round" stroke-linejoin="round"/> |
| @@ -37,30 +50,30 @@ | ||
| 37 | 50 | <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> |
| 38 | 51 | <path d="M12.8334 7C12.8334 10.22 10.22 12.8333 7.00002 12.8333C3.78002 12.8333 1.16669 10.22 1.16669 7C1.16669 3.78 3.78002 1.16666 7.00002 1.16666C10.22 1.16666 12.8334 3.78 12.8334 7Z" stroke="#445164" stroke-linecap="round" stroke-linejoin="round"/> |
| 39 | 52 | <path d="M9.16418 8.855L7.35585 7.77584C7.04085 7.58917 6.78418 7.14 6.78418 6.7725V4.38084" stroke="#445164" stroke-linecap="round" stroke-linejoin="round"/> |
| 40 | 53 | </svg> |
| 41 | - <?php if (count($event->durations) > 1) { ?> | |
| 54 | + <?php if (count($fluentBookingEvent->durations) > 1) { ?> | |
| 42 | 55 | <?php echo esc_html__('Durations', 'fluent-booking'); ?> |
| 43 | 56 | |
| 44 | 57 | <div class="fcal_location_tooltip"> |
| 45 | - <?php foreach ($event->durations as $duration) { ?> | |
| 58 | + <?php foreach ($fluentBookingEvent->durations as $fluentBookingDuration) { ?> | |
| 46 | 59 | <span class="fcal_slot_duration"> |
| 47 | 60 | <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> |
| 48 | 61 | <path d="M12.8334 7C12.8334 10.22 10.22 12.8333 7.00002 12.8333C3.78002 12.8333 1.16669 10.22 1.16669 7C1.16669 3.78 3.78002 1.16666 7.00002 1.16666C10.22 1.16666 12.8334 3.78 12.8334 7Z" stroke="#445164" stroke-linecap="round" stroke-linejoin="round"/> |
| 49 | 62 | <path d="M9.16418 8.855L7.35585 7.77584C7.04085 7.58917 6.78418 7.14 6.78418 6.7725V4.38084" stroke="#445164" stroke-linecap="round" stroke-linejoin="round"/> |
| 50 | 63 | </svg> |
| 51 | - <?php echo esc_html($duration); ?> | |
| 64 | + <?php echo esc_html($fluentBookingDuration); ?> | |
| 52 | 65 | </span> |
| 53 | 66 | <?php } ?> |
| 54 | 67 | </div> |
| 55 | 68 | <?php } else { |
| 56 | - echo esc_html($event->durations[0]); | |
| 69 | + echo esc_html($fluentBookingEvent->durations[0]); | |
| 57 | 70 | } ?> |
| 58 | 71 | </span> |
| 59 | 72 | |
| 60 | 73 | <span class="fcal_slot_location"> |
| 61 | 74 | <?php |
| 62 | - if (count($event->location_settings) > 1) { ?> | |
| 75 | + if (count($fluentBookingEvent->location_settings) > 1) { ?> | |
| 63 | 76 | <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-map-pin"> |
| 64 | 77 | <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"> |
| 65 | 78 | </path><circle cx="12" cy="10" r="3"></circle> |
| 66 | 79 | </svg> |
| @@ -65,23 +78,23 @@ | ||
| 65 | 78 | </path><circle cx="12" cy="10" r="3"></circle> |
| 66 | 79 | </svg> |
| 67 | 80 | <?php echo esc_html__('Locations', 'fluent-booking'); ?> |
| 68 | 81 | <span class="fcal_location_tooltip"> |
| 69 | - <?php echo wp_kses_post($event->locations); ?> | |
| 82 | + <?php echo wp_kses_post($fluentBookingEvent->locations); ?> | |
| 70 | 83 | </span> |
| 71 | 84 | <?php } else { |
| 72 | - echo wp_kses_post($event->locations); | |
| 85 | + echo wp_kses_post($fluentBookingEvent->locations); | |
| 73 | 86 | } ?> |
| 74 | 87 | </span> |
| 75 | 88 | |
| 76 | - <?php if ($event->payment_html) { ?> | |
| 77 | - <?php echo $event->payment_html; ?> | |
| 89 | + <?php if ($fluentBookingEvent->payment_html) { ?> | |
| 90 | + <?php echo $fluentBookingEvent->payment_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> | |
| 78 | 91 | <?php } ?> |
| 79 | 92 | |
| 80 | - <?php if ($event->event_time) { ?> | |
| 93 | + <?php if ($fluentBookingEvent->event_time) { ?> | |
| 81 | 94 | <span class="fcal_slot_time"> |
| 82 | 95 | <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none"><path d="M6 1.5V3.75" stroke="#445164" stroke-width="1.25" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 1.5V3.75" stroke="#445164" stroke-width="1.25" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M2.625 6.8175H15.375" stroke="#445164" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.75 6.375V12.75C15.75 15 14.625 16.5 12 16.5H6C3.375 16.5 2.25 15 2.25 12.75V6.375C2.25 4.125 3.375 2.625 6 2.625H12C14.625 2.625 15.75 4.125 15.75 6.375Z" stroke="#445164" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.771 10.275H11.7778" stroke="#445164" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.771 12.525H11.7778" stroke="#445164" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.99661 10.275H9.00335" stroke="#445164" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.99661 12.525H9.00335" stroke="#445164" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M6.22073 10.275H6.22747" stroke="#445164" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M6.22073 12.525H6.22747" stroke="#445164" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg> |
| 83 | - <?php echo esc_html(\FluentBooking\App\Services\DateTimeHelper::getFormattedEventTime($event->event_time)); ?> | |
| 96 | + <?php echo esc_html(\FluentBooking\App\Services\DateTimeHelper::getFormattedEventTime($fluentBookingEvent->event_time)); ?> | |
| 84 | 97 | </span> |
| 85 | 98 | <?php } ?> |
| 86 | 99 | </div> |
| 87 | 100 | </div> |
| @@ -87,10 +100,10 @@ | ||
| 87 | 100 | </div> |
| 88 | 101 | <button class="book_now"> |
| 89 | 102 | <?php esc_html_e('Book Now', 'fluent-booking'); ?> |
| 90 | 103 | <svg xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21" fill="none"> |
| 91 | - <path d="M12.025 5.44167L17.0833 10.5L12.025 15.5583" stroke="#306AE0" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/> | |
| 92 | - <path d="M2.91666 10.5H16.9417" stroke="#306AE0" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/> | |
| 104 | + <path d="M12.025 5.44167L17.0833 10.5L12.025 15.5583" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/> | |
| 105 | + <path d="M2.91666 10.5H16.9417" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/> | |
| 93 | 106 | </svg> |
| 94 | 107 | </button> |
| 95 | 108 | </a> |
| 96 | 109 | </div> |