PluginProbe
VikBooking Hotel Booking Engine & PMS / trunk
VikBooking Hotel Booking Engine & PMS vtrunk
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 1.7.3 All 36 releases
vikbooking / site / views / operators / view.html.php

view.html.php in VikBooking Hotel Booking Engine & PMS trunk, at site/views/operators/view.html.php

60 lines 1.9 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 - 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 class VikbookingViewOperators extends JViewVikBooking
16 {
17 public function display($tpl = null)
18 {
19 VikBooking::prepareViewContent();
20
21 $app = JFactory::getApplication();
22
23 // access the global operators object
24 $oper_obj = VikBooking::getOperatorInstance();
25
26 // attempt to get the current operator
27 $operator = $oper_obj->getOperatorAccount();
28
29 // check request value for a custom tool
30 $tool = $app->input->getString('tool', '');
31
32 if ($operator === false) {
33 // operator needs to log in (default_login.php)
34 $tpl = 'login';
35 } elseif ($tool) {
36 /**
37 * Change layout from default to "tool" (tool.php).
38 *
39 * @since 1.16.9 (J) - 1.6.9 (WP)
40 */
41 $this->setLayout('tool');
42 } else {
43 // operator is logged in (default_dashboard.php)
44 $tpl = 'dashboard';
45 }
46
47 // convert the JSON strings into array values
48 if ($operator) {
49 $operator['perms'] = !empty($operator['perms']) ? (is_scalar($operator['perms']) ? (array) json_decode($operator['perms'], true) : $operator['perms']) : [];
50 $operator['work_days_week'] = !empty($operator['work_days_week']) ? (is_scalar($operator['work_days_week']) ? (array) json_decode($operator['work_days_week'], true) : $operator['work_days_week']) : [];
51 $operator['work_days_exceptions'] = !empty($operator['work_days_exceptions']) ? (is_scalar($operator['work_days_exceptions']) ? (array) json_decode($operator['work_days_exceptions'], true) : $operator['work_days_exceptions']) : [];
52 }
53
54 $this->operator = $operator;
55 $this->tool = $tool;
56
57 parent::display($tpl);
58 }
59 }
60