aboutsummaryrefslogtreecommitdiffstats
path: root/mod/events.php
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2014-11-26 11:02:30 -0800
committerHabeas Codice <habeascodice@federated.social>2014-11-26 11:02:30 -0800
commitd3ffdbf2a4e25636cb2762f35c69fcc1abbcf7d5 (patch)
tree0dd876ff9767998ec13c73cab2ff02f5cbce371a /mod/events.php
parent1a57f3ed517e7dd68bd6c7a23802ebee138c128f (diff)
parent3bb0ef8a82ec660ff8ef37b9abc93da94234649a (diff)
downloadvolse-hubzilla-d3ffdbf2a4e25636cb2762f35c69fcc1abbcf7d5.tar.gz
volse-hubzilla-d3ffdbf2a4e25636cb2762f35c69fcc1abbcf7d5.tar.bz2
volse-hubzilla-d3ffdbf2a4e25636cb2762f35c69fcc1abbcf7d5.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/events.php')
-rwxr-xr-xmod/events.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/mod/events.php b/mod/events.php
index 5af7d381e..e016311d5 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -275,6 +275,11 @@ function events_content(&$a) {
if(! $m)
$m = intval($thismonth);
+ $export = false;
+ if(argc() === 4 && argv(3) === 'export')
+ $export = true;
+
+
// Put some limits on dates. The PHP date functions don't seem to do so well before 1900.
// An upper limit was chosen to keep search engines from exploring links millions of years in the future.
@@ -413,6 +418,12 @@ function events_content(&$a) {
}
}
+ if($export) {
+ header('Content-type: text/calendar');
+ echo ical_wrapper($r);
+ killme();
+ }
+
if ($a->argv[1] === 'json'){
echo json_encode($events); killme();
}
@@ -432,6 +443,7 @@ function events_content(&$a) {
'$new_event'=> array($a->get_baseurl().'/events/new',t('Create New Event'),'',''),
'$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''),
'$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''),
+ '$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''),
'$calendar' => cal($y,$m,$links, ' eventcal'),
'$events' => $events,