Files
2024-12-17 17:34:10 +01:00

57 lines
1.4 KiB
PHP

<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Factory;
/**
* Raw: Venue
*/
class JemViewVenue extends HtmlView
{
/**
* Creates the output for the Venue view
*/
public function display($tpl = null)
{
$settings = JemHelper::config();
$settings2 = JemHelper::globalattribs();
$app = Factory::getApplication();
$jinput = $app->input;
$year = (int)$jinput->getInt('yearID', date("Y"));
$month = (int)$jinput->getInt('monthID', date("m"));
if ($settings2->get('global_show_ical_icon','0')==1) {
// Get data from the model
$model = $this->getModel('VenueCal');
$model->setState('list.start',0);
$model->setState('list.limit',$settings->ical_max_items);
$model->setDate(mktime(0, 0, 1, $month, 1, $year));
$rows = $model->getItems();
$venueid = $jinput->getInt('id');
// initiate new CALENDAR
$vcal = JemHelper::getCalendarTool();
$vcal->setConfig("filename", "events_venue_" . $venueid . "_" . $year . $month . "ics");
if (!empty($rows)) {
foreach ($rows as $row) {
JemHelper::icalAddEvent($vcal, $row);
}
}
// generate and redirect output to user browser
$vcal->returnCalendar();
}
}
}