| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package VikBooking |
| 4 |
* @subpackage com_vikbooking |
| 5 |
* @author Alessio Gaggii - E4J srl |
| 6 |
* @copyright Copyright (C) 2025 E4J srl. All rights reserved. |
| 7 |
* @license GNU General Public License version 2 or later; see LICENSE |
| 8 |
* @link https://vikwp.com |
| 9 |
*/ |
| 10 |
|
| 11 |
defined('ABSPATH') or die('No script kiddies please!'); |
| 12 |
|
| 13 |
/** |
| 14 |
* Display data attributes. |
| 15 |
* |
| 16 |
* @var string $uri |
| 17 |
* @var array $context |
| 18 |
* @var array $messages |
| 19 |
* @var array $users |
| 20 |
* @var object $user |
| 21 |
* @var array $options |
| 22 |
*/ |
| 23 |
extract($displayData); |
| 24 |
|
| 25 |
$id = 'chat-' . $context['alias'] . '-' . $context['id'] . '-' . $options['suffix']; |
| 26 |
|
| 27 |
?> |
| 28 |
|
| 29 |
<div class="vbo-chat-wrapper" id="<?php echo $id; ?>"> |
| 30 |
|
| 31 |
<div class="chat-messages-panel"> |
| 32 |
|
| 33 |
<div class="chat-conversation"> |
| 34 |
|
| 35 |
</div> |
| 36 |
|
| 37 |
<div class="chat-input-footer"> |
| 38 |
<div class="textarea-input"></div> |
| 39 |
|
| 40 |
<div class="chat-uploads-bar" style="display:none;"> |
| 41 |
<div class="chat-progress-wrap"></div> |
| 42 |
<div class="chat-uploads-tab"></div> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
|
| 46 |
</div> |
| 47 |
|
| 48 |
</div> |
| 49 |
|
| 50 |
<?php if (isset($messages)): ?> |
| 51 |
<script> |
| 52 |
(function($) { |
| 53 |
'use strict'; |
| 54 |
|
| 55 |
$(function() { |
| 56 |
VBOChat.getInstance({ |
| 57 |
environment: { |
| 58 |
url: '<?php echo $uri; ?>', |
| 59 |
messages: <?php echo json_encode($messages) ?>, |
| 60 |
users: <?php echo json_encode($users); ?>, |
| 61 |
user: <?php echo json_encode($user); ?>, |
| 62 |
context: <?php echo json_encode($context); ?>, |
| 63 |
options: <?php echo json_encode($options); ?>, |
| 64 |
selector: '#<?php echo $id; ?>', |
| 65 |
}, |
| 66 |
}).prepare(); |
| 67 |
}); |
| 68 |
})(jQuery); |
| 69 |
</script> |
| 70 |
<?php endif; ?> |