| 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 |
/** |
| 14 |
* Class handler for admin widget "forecast". |
| 15 |
* |
| 16 |
* @since 1.4.0 |
| 17 |
*/ |
| 18 |
class VikBookingAdminWidgetForecast extends VikBookingAdminWidget |
| 19 |
{ |
| 20 |
/** |
| 21 |
* Class constructor will define the widget name and identifier. |
| 22 |
*/ |
| 23 |
public function __construct() |
| 24 |
{ |
| 25 |
// call parent constructor |
| 26 |
parent::__construct(); |
| 27 |
|
| 28 |
$this->widgetName = JText::translate('VBO_W_OCCFORECAST_TITLE'); |
| 29 |
$this->widgetDescr = JText::translate('VBO_W_OCCFORECAST_DESCR'); |
| 30 |
$this->widgetId = basename(__FILE__, '.php'); |
| 31 |
|
| 32 |
/** |
| 33 |
* Define widget and icon and style name. |
| 34 |
* |
| 35 |
* @since 1.15.0 (J) - 1.5.0 (WP) |
| 36 |
*/ |
| 37 |
$this->widgetIcon = '<i class="' . VikBookingIcons::i('cloud-sun-rain') . '"></i>'; |
| 38 |
$this->widgetStyleName = 'yellow'; |
| 39 |
} |
| 40 |
|
| 41 |
public function render(?VBOMultitaskData $data = null) |
| 42 |
{ |
| 43 |
$vbo_auth_pricing = JFactory::getUser()->authorise('core.vbo.pricing', 'com_vikbooking'); |
| 44 |
$vbo_auth_bookings = JFactory::getUser()->authorise('core.vbo.bookings', 'com_vikbooking'); |
| 45 |
|
| 46 |
if (!$vbo_auth_pricing || !$vbo_auth_bookings) { |
| 47 |
// base permissions are not met |
| 48 |
return; |
| 49 |
} |
| 50 |
|
| 51 |
$layout_data = array( |
| 52 |
'vbo_page' => 'dashboard', |
| 53 |
); |
| 54 |
?> |
| 55 |
<div class="vbo-admin-widget-wrapper"> |
| 56 |
<div class="vbo-admin-widget-head"> |
| 57 |
<h4><?php echo $this->widgetIcon; ?> <span><?php echo JText::translate('VBOFORECAST'); ?></span></h4> |
| 58 |
</div> |
| 59 |
<div class="vbo-dashboard-forecast-inner"> |
| 60 |
<?php echo JLayoutHelper::render('reports.occupancy', $layout_data); ?> |
| 61 |
</div> |
| 62 |
</div> |
| 63 |
<?php |
| 64 |
} |
| 65 |
} |
| 66 |
|