$modday = $HTTP_POST_VARS["modday"]; mt_srand((double) microtime() * 1000000); if (empty($id)) { $id = "all"; } if ($format == "ical") { transmit_header('text/ical', "webcalendar-{$id}.ics"); export_ical($id); } elseif ($format == "vcal") { transmit_header('text/vcal', "webcalendar-{$id}.vcs"); export_vcal($id); } elseif ($format == "pilot-csv") { transmit_header('text/csv', "webcalendar-{$id}.csv"); export_pilot_csv($id); } elseif ($format == "pilot-text") { transmit_header('text/plain', "webcalendar-{$id}.txt"); export_install_datebook($id); } else { //exit; print_header(); echo "<h2>"; etranslate("Export"); echo " "; etranslate("Error"); echo "</h2>\n"; echo "<span style=\"font-weight:bold;\">"; etranslate("Error"); echo ":</span> "; echo translate("export format not defined or incorrect") . "."; echo "<br />\n"; print_trailer();
$modmonth = getValue('modmonth', '-?[0-9]+', true); $modyear = getValue('modyear', '-?[0-9]+', true); $startdate = sprintf("%04d%02d%02d", $fromyear, $frommonth, $fromday); $enddate = sprintf("%04d%02d%02d", $endyear, $endmonth, $endday); $moddate = sprintf("%04d%02d%02d", $modyear, $modmonth, $modday); mt_srand((double) microtime() * 1000000); if (empty($id)) { $id = 'all'; } $outputName = 'webcalendar-' . "{$login}-{$id}"; if (substr($format, 0, 4) == 'ical') { transmit_header('text/calendar', $outputName . '.ics'); export_ical($id); } elseif ($format == 'vcal') { transmit_header('text/x-vCalendar', $outputName . '.vcs'); export_vcal($id); } elseif ($format == 'pilot-csv') { transmit_header('text/csv', $outputName . '.csv'); export_pilot_csv($id); } elseif ($format == 'pilot-text') { transmit_header('text/plain', $outputName . '.txt'); export_install_datebook($id); } else { print_header(); $errorStr = translate('Error'); echo ' <h2>' . translate('Export') . ' ' . $errorStr . '</h2> <span class="bold">' . $errorStr . ':</span> ' . translate('export format not defined or incorrect') . '.<br /> ' . print_trailer(); } //end if ($format == "ical")