default.php
1 month ago
default.xml
1 month ago
default_appointment.php
1 month ago
default_attendees.php
1 month ago
default_backbutton.php
1 month ago
default_countdown.php
1 month ago
default_locations.php
1 month ago
default_orderdetails.php
1 month ago
default_service.php
1 month ago
default_usernote.php
1 month ago
default_usernote_block.php
1 month ago
index.html
1 month ago
track.php
1 month ago
default_attendees.php
105 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | $order = $this->order; |
| 15 | |
| 16 | $dispatcher = VAPFactory::getEventDispatcher(); |
| 17 | |
| 18 | foreach ($order->attendees as $i => $attendee) |
| 19 | { |
| 20 | $forms = array(); |
| 21 | |
| 22 | foreach (array('top', 'actions', 'bottom') as $location) |
| 23 | { |
| 24 | /** |
| 25 | * Trigger event to let the plugins add custom HTML contents within the attendee box. |
| 26 | * |
| 27 | * @param string $location The HTML will be always placed after the specified location. |
| 28 | * @param array $attendee The attendee details array. |
| 29 | * @param integer $index The current attendee number. |
| 30 | * |
| 31 | * @return string The HTML to display. |
| 32 | * |
| 33 | * @since 1.7 |
| 34 | */ |
| 35 | $html = array_filter($dispatcher->trigger('onDisplayAttendeeDetails', array($location, $attendee, $i))); |
| 36 | |
| 37 | // display all returned blocks, separated by a new line |
| 38 | $forms[$location] = implode("\n", $html); |
| 39 | } |
| 40 | |
| 41 | // do not display the attendee block in case of empty fields |
| 42 | if (empty($attendee['display']) && !array_filter($forms)) |
| 43 | { |
| 44 | continue; |
| 45 | } |
| 46 | |
| 47 | ?> |
| 48 | <div class="vaporderboxcontent"> |
| 49 | |
| 50 | <!-- BOX TITLE --> |
| 51 | |
| 52 | <div class="vap-order-first"> |
| 53 | |
| 54 | <h3 class="vaporderheader vap-head-first"><?php echo JText::sprintf('VAP_N_ATTENDEE', $i + 2); ?></h3> |
| 55 | |
| 56 | <!-- Define role to detect the supported hook --> |
| 57 | <!-- {"rule":"customizer","event":"onDisplayAttendeeDetails","type":"sitepage","key":"actions"} --> |
| 58 | |
| 59 | <?php |
| 60 | // display custom HTML within the actions toolbar |
| 61 | echo $forms['actions']; |
| 62 | ?> |
| 63 | |
| 64 | </div> |
| 65 | |
| 66 | <!-- LEFT SIDE --> |
| 67 | |
| 68 | <div class="vaporderboxleft"> |
| 69 | <div class="vapordercontentinfo"> |
| 70 | |
| 71 | <!-- Define role to detect the supported hook --> |
| 72 | <!-- {"rule":"customizer","event":"onDisplayAttendeeDetails","type":"sitepage","key":"top"} --> |
| 73 | |
| 74 | <?php |
| 75 | // display custom HTML at the beginning of the order details |
| 76 | echo $forms['top']; |
| 77 | ?> |
| 78 | |
| 79 | <?php |
| 80 | foreach ($attendee['display'] as $key => $val) |
| 81 | { |
| 82 | ?> |
| 83 | <div class="vaporderinfo"> |
| 84 | <span class="vaporderinfo-lbl"><?php echo $key; ?></span> |
| 85 | <span class="vaporderinfo-value"><?php echo nl2br($val); ?></span> |
| 86 | </div> |
| 87 | <?php |
| 88 | } |
| 89 | ?> |
| 90 | |
| 91 | <!-- Define role to detect the supported hook --> |
| 92 | <!-- {"rule":"customizer","event":"onDisplayAttendeeDetails","type":"sitepage","key":"bottom"} --> |
| 93 | |
| 94 | <?php |
| 95 | // display custom HTML at the beginning of the order details |
| 96 | echo $forms['bottom']; |
| 97 | ?> |
| 98 | |
| 99 | </div> |
| 100 | </div> |
| 101 | |
| 102 | </div> |
| 103 | <?php |
| 104 | } |
| 105 |