PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / site / views / serviceslist / tmpl / default_service.php
vikappointments / site / views / serviceslist / tmpl Last commit date
default.php 6 days ago default.xml 6 days ago default_group.php 6 days ago default_service.php 6 days ago index.html 6 days ago
default_service.php
114 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 $vik = VAPApplication::getInstance();
15 $config = VAPFactory::getConfig();
16
17 // build service details URL
18 $url = JRoute::rewrite('index.php?option=com_vikappointments&view=servicesearch&id_service=' . $this->service->id . ($this->itemid ? '&Itemid=' . $this->itemid : ''));
19
20 // fetch image action preferences
21 $link_href = $config->getUint('serlinkhref');
22
23 ?>
24
25 <div class="vapserblock <?php echo $vik->getThemeClass('background'); ?>" id="vapserblock<?php echo $this->service->id; ?>">
26
27 <div class="vapserwrapper">
28
29 <div class="vapserimage" id="vapimage<?php echo $this->service->id; ?>">
30 <?php
31 if ($this->service->image)
32 {
33 // render image tag
34 $image = JHtml::fetch('vaphtml.media.display', $this->service->image, [
35 'loading' => 'lazy',
36 'alt' => $this->service->name,
37 'small' => false,
38 ]);
39
40 if ($link_href == 2)
41 {
42 // by clicking the image, the system should open a popup containing the original image
43 ?>
44 <a href="javascript:void(0)" class="vapmodal" onClick="vapOpenModalImage('<?php echo VAPMEDIA_URI . $this->service->image; ?>', this);">
45 <?php echo $image; ?>
46 </a>
47 <?php
48 }
49 else
50 {
51 // by clicking the image, the users are redirected to the details of the service
52 ?>
53 <a href="<?php echo $url; ?>">
54 <?php echo $image; ?>
55 </a>
56 <?php
57 }
58 }
59 ?>
60 </div>
61
62 <div class="vapsername">
63 <a href="<?php echo $url; ?>">
64 <?php echo $this->service->name; ?>
65 </a>
66 </div>
67
68 <?php
69 if (VikAppointments::isServicesReviewsEnabled())
70 {
71 ?>
72 <div class="vapserbottomreview">
73 <div class="reviewleft">
74 <?php
75 // Display the rating stars through this helper method.
76 // Set the argument to false to use FontAwesome icons
77 // in place of the images.
78 echo JHtml::fetch('vikappointments.rating', $this->service->rating, $image = true);
79 ?>
80 </div>
81
82 <div class="reviewright">
83 <?php echo JText::plural('VAPREVIEWSSUBTITLE_N', $this->service->reviewsCount); ?>
84 </div>
85 </div>
86 <?php
87 }
88 ?>
89
90 </div>
91
92 <?php
93 if (($link_href == 3 && $this->service->description) || empty($this->service->image))
94 {
95 // If the image is empty or the service description should be shown,
96 // put a box containing the description of the service.
97 ?>
98 <div class="vapserdescwrap <?php echo ($this->service->image ? '' : 'always'); ?>" id="vapdesc<?php echo $this->service->id; ?>">
99 <div class="vapserdesc">
100 <?php
101 // get maximum number of supported characters
102 $max_length = $config->getUint('serdesclength');
103
104 // display short description
105 echo VikAppointments::renderShortHtmlDescription($this->service->description, $max_length);
106 ?>
107 </div>
108 </div>
109 <?php
110 }
111 ?>
112
113 </div>
114