/** * Creates the output for the Venue view */ function display($tpl = null) { $settings = JemHelper::config(); $settings2 = JemHelper::globalattribs(); $app = JFactory::getApplication(); $jinput = JFactory::getApplication()->input; if ($settings2->get('global_show_ical_icon', '0') == 1) { // Get data from the model $model = $this->getModel(); $model->setLimit($settings->ical_max_items); $model->setLimitstart(0); $rows = $model->getItems(); $venueid = $jinput->getInt('id'); // initiate new CALENDAR $vcal = JemHelper::getCalendarTool(); // $vcal->setProperty('unique_id', 'category'.$catid.'@'.$mainframe->getCfg('sitename')); $vcal->setConfig("filename", "venue" . $venueid . ".ics"); foreach ($rows as $row) { JemHelper::icalAddEvent($vcal, $row, $rows); } // generate and redirect output to user browser $vcal->returnCalendar(); } else { return; } }
/** * Creates the output for the event view */ function display($tpl = null) { $settings = JemHelper::globalattribs(); // check iCal global setting if ($settings->get('global_show_ical_icon','0')==1) { // Get data from the model $row = $this->get('Item'); if (empty($row)) { return; } $row->categories = $this->get('Categories'); $row->id = $row->did; $row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id; $params = $row->params; // check individual iCal Event setting if ($params->get('event_show_ical_icon',1)) { // initiate new CALENDAR $vcal = JemHelper::getCalendarTool(); $vcal->setConfig( "filename", "event".$row->did.".ics" ); JemHelper::icalAddEvent($vcal, $row); // generate and redirect output to user browser $vcal->returnCalendar(); } else { return; } } else { return; } }
/** * Creates the output for the Eventslist view */ function display($tpl = null) { $settings = JemHelper::config(); $settings2 = JemHelper::globalattribs(); if ($settings2->get('global_show_ical_icon','0')==1) { // Get data from the model $model = $this->getModel(); $model->setLimit($settings->ical_max_items); $model->setLimitstart(0); $rows = $model->getItems(); // initiate new CALENDAR $vcal = JemHelper::getCalendarTool(); $vcal->setConfig("filename", "events.ics"); if (!empty($rows)) { foreach ($rows as $row) { JemHelper::icalAddEvent($vcal, $row); } } // generate and redirect output to user browser $vcal->returnCalendar(); } else { return; } }
/** * Creates the output for the event view */ function display($tpl = null) { $settings = JemHelper::globalattribs(); // check iCal global setting if ($settings->get('global_show_ical_icon', '0') == 1) { // Get data from the model $row = $this->get('Item'); $row->categories = $this->get('Categories'); $row->id = $row->did; $row->slug = $row->alias ? $row->id . ':' . $row->alias : $row->id; $params = $row->params; // check individual iCal Event setting if ($params->get('event_show_ical_icon', 1)) { $filename_type = $params->get('event_ical_filename_type', '2'); switch ($filename_type) { case 1: $filename = JText::_('COM_JEM_EVENT_ICAL_FILENAME'); break; case 2: $filename = "event" . $row->did; break; case 3: $filename = $params->get('event_ical_filename', 'event'); break; } // initiate new CALENDAR $vcal = JemHelper::getCalendarTool(); $vcal->setConfig("filename", $filename . '.ics'); JemHelper::icalAddEvent($vcal, $row, 'event'); // generate and redirect output to user browser $vcal->returnCalendar(); } else { return; } } else { return; } }