| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package VikBooking |
| 4 |
* @subpackage com_vikbooking |
| 5 |
* @author Alessio Gaggii - e4j - Extensionsforjoomla.com |
| 6 |
* @copyright Copyright (C) 2018 e4j - Extensionsforjoomla.com. 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 |
jimport('joomla.application.component.view'); |
| 14 |
|
| 15 |
/** |
| 16 |
* VikBooking chat view. |
| 17 |
* |
| 18 |
* @since 1.18.8 (J) - 1.8.8 (WP) |
| 19 |
*/ |
| 20 |
class VikbookingViewChat extends JViewVikBooking |
| 21 |
{ |
| 22 |
/** |
| 23 |
* @inheritDoc |
| 24 |
*/ |
| 25 |
public function display($tpl = null) |
| 26 |
{ |
| 27 |
$app = JFactory::getApplication(); |
| 28 |
$sessionModel = new VBOChatSessionModel; |
| 29 |
|
| 30 |
// get token from request to resume a session |
| 31 |
$token = $app->input->getAlnum('token'); |
| 32 |
|
| 33 |
// in case the user never started a chat from this browser and the URL includes a token, resume the session |
| 34 |
if (!$sessionModel->getCookieToken() && $token) { |
| 35 |
$sessionModel->setCookieToken($token); |
| 36 |
} |
| 37 |
|
| 38 |
$this->session = $sessionModel->getFromCookie(); |
| 39 |
|
| 40 |
if (!$this->session) { |
| 41 |
$this->setLayout('error'); |
| 42 |
} |
| 43 |
|
| 44 |
parent::display($tpl); |
| 45 |
} |
| 46 |
} |
| 47 |
|