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 / layouts / review / default.php
vikappointments / site / layouts / review Last commit date
default.php 6 days ago index.html 6 days ago
default.php
117 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 $review = isset($displayData['review']) ? $displayData['review'] : false;
15 $dt_format = isset($displayData['datetime_format']) ? $displayData['datetime_format'] : 'Y-m-d H:i';
16
17 if (!$review)
18 {
19 // do not proceed if the review is not provided
20 return;
21 }
22
23 // Alter this value in case you want to increase/decrease
24 // the total number of characters shown for each review.
25 // By default, this value is set to 300 characters.
26 $COMMENT_DESC_LENGTH = 300;
27
28 $review_comment = $review->comment;
29
30 if (strlen($review->comment) > $COMMENT_DESC_LENGTH + 3)
31 {
32 $review_comment = trim(mb_substr($review_comment, 0, $COMMENT_DESC_LENGTH, 'UTF-8'), '. ') . ' ...';
33 }
34
35 if (!empty($review->image))
36 {
37 $avatar = VAPCUSTOMERS_AVATAR_URI . $review->image;
38 }
39 else
40 {
41 $avatar = VAPASSETS_URI . 'css/images/default-profile.png';
42 }
43
44 $vik = VAPApplication::getInstance();
45
46 // use customer timezone
47 $tz = VikAppointments::getUserTimezone()->getName();
48
49 ?>
50
51 <div class="vap-review-line <?php echo $vik->getThemeClass('background'); ?>">
52
53 <!-- LEFT BOX -->
54 <div class="vap-review-left">
55
56 <div class="vap-review-profile">
57
58 <div class="vap-review-userimage">
59 <img src="<?php echo $avatar; ?>" />
60 </div>
61
62 <div class="vap-review-username">
63 <?php echo $review->name; ?>
64 </div>
65
66 </div>
67
68 </div>
69
70 <!-- CENTER BOX -->
71 <div class="vap-review-center">
72
73 <div class="vap-review-header">
74
75 <div class="vap-review-title">
76 <?php echo $review->title; ?>
77 </div>
78
79 <div class="vap-review-rating">
80 <?php
81 // Display the rating stars through this helper method.
82 // Set the argument to false to use FontAwesome icons
83 // in place of the images.
84 echo JHtml::fetch('vikappointments.rating', $review->rating, $image = true);
85 ?>
86 </div>
87
88 <div class="vap-review-date">
89 <?php echo JHtml::fetch('date', $review->timestamp, $dt_format, $tz); ?>
90 </div>
91
92 </div>
93
94 <div class="vap-review-comment" id="vaprevcomment<?php echo $review->id; ?>">
95 <?php echo $review_comment; ?>
96 </div>
97
98 <div class="vap-review-morecomment">
99 <?php
100 if (strlen($review_comment) != strlen($review->comment))
101 {
102 ?>
103 <a href="javascript:void(0)" onClick="showMoreLessDescription(this, <?php echo $review->id; ?>);">
104 <?php echo JText::translate('VAPREVIEWCOMMENTSHOWMORE'); ?>
105 </a>
106
107 <input type="hidden" id="vaprevcomtype<?php echo $review->id; ?>" value="more" />
108 <input type="hidden" id="vaprevcomfull<?php echo $review->id; ?>" value="<?php echo $this->escape($review->comment); ?>" />
109 <?php
110 }
111 ?>
112 </div>
113
114 </div>
115
116 </div>
117