PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.11
VikBooking Hotel Booking Engine & PMS v1.8.11
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
vikbooking / site / layouts / chat / session.php

session.php in VikBooking Hotel Booking Engine & PMS 1.8.11, at site/layouts/chat/session.php

54 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikBooking
4 * @subpackage com_vikbooking
5 * @author Alessio Gaggii - E4J srl
6 * @copyright Copyright (C) 2024 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 vars.
15 *
16 * @var VBOChatMediator|null $chat The chat mediator instance.
17 * @var object|null $session The chat session.
18 * @var string $suffix The selector suffix.
19 * @var array $options The chat settings.
20 */
21 extract($displayData);
22
23 if (empty($chat)) {
24 // get the chat mediator
25 $chat = VBOFactory::getChatMediator();
26 }
27
28 // load the assets only
29 $chat->useAssets();
30
31 if (!array_key_exists('session', $displayData)) {
32 // get session from cookie
33 $session = (new VBOChatSessionModel)->getFromCookie();
34 }
35
36 // sanitize suffix
37 $suffix = preg_replace("/[^a-zA-Z0-9_\-]+/", '', (string) ($suffix ?? ''));
38
39 ?>
40
41 <div id="chat-session-target<?php echo $this->escape($suffix); ?>" class="chat-session-target">
42 <?php
43 if ($session) {
44 // build chat for the given context
45 $context = $chat->createContext('session', $session->id);
46
47 // display the chat for the current session
48 echo $chat->render($context, array_merge($options ?? [], [
49 'assets' => false,
50 ]));
51 }
52 ?>
53 </div>
54