$parameter['view_mode'] = 'period'; $parameter['date_from'] = date('Y-m-d', time() - $gPreferences['dates_ical_days_past'] * 86400); $parameter['date_to'] = date('Y-m-d', time() + $gPreferences['dates_ical_days_future'] * 86400); // read events for output $datesResult = $dates->getDataset(); //Headline für Dateinamen if ($dates->getCatId() > 0) { $calendar = new TableCategory($gDb, $dates->getCatId()); $getHeadline .= '_' . $calendar->getValue('cat_name'); } $date = new TableDate($gDb); $iCal = $date->getIcalHeader(); if ($datesResult['numResults'] > 0) { $date = new TableDate($gDb); foreach ($datesResult['recordset'] as $row) { $date->clear(); $date->setArray($row); $iCal .= $date->getIcalVEvent($_SERVER['HTTP_HOST']); } } $iCal .= $date->getIcalFooter(); if ($parameter['mode'] == 2) { // for IE the filename must have special chars in hexadecimal if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) { $getHeadline = urlencode($getHeadline); } header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="' . $getHeadline . '.ics"'); // necessary for IE, because without it the download with SSL has problems header('Cache-Control: private'); header('Pragma: public');
// wenn leer, dann Standardpfad zum Admidio-Modul if (!isset($plg_link_url) || $plg_link_url === '') { $plg_link_url = $g_root_path . '/adm_program/modules/dates/dates.php'; } // create Object $plgDates = new ModuleDates(); // read events for output $plgDatesResult = $plgDates->getDataSet(0, $plg_dates_count); $plg_date = new TableDate($gDb); echo '<div id="plugin_' . $plugin_folder . '" class="admidio-plugin-content">'; if ($plg_show_headline == 1) { echo '<h3>' . $gL10n->get('PLG_DATES_HEADLINE') . '</h3>'; } if ($plgDatesResult['numResults'] > 0) { foreach ($plgDatesResult['recordset'] as $plg_row) { $plg_date->clear(); $plg_date->setArray($plg_row); $plg_html_end_date = ''; echo '<div>' . $plg_date->getValue('dat_begin', $gPreferences['system_date']) . ' '; if ($plg_date->getValue('dat_all_day') != 1) { echo $plg_date->getValue('dat_begin', $gPreferences['system_time']); } // Bis-Datum und Uhrzeit anzeigen if ($plg_show_date_end) { if ($plg_date->getValue('dat_begin', $gPreferences['system_date']) != $plg_date->getValue('dat_end', $gPreferences['system_date'])) { $plg_html_end_date .= $plg_date->getValue('dat_end', $gPreferences['system_date']); } if ($plg_date->getValue('dat_all_day') != 1) { $plg_html_end_date .= ' ' . $plg_date->getValue('dat_end', $gPreferences['system_time']); } if ($plg_html_end_date !== '') {