diff options
author | friendica <info@friendica.com> | 2014-11-24 02:50:14 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-11-24 02:50:14 -0800 |
commit | 756abd66783344f5dcbb0a146d9281e027181837 (patch) | |
tree | d6f5bb45beddd4ded4edb3535712b989935a917a /mod | |
parent | 53dc9cf2eb078f452979dc1dc9146ab993425621 (diff) | |
download | volse-hubzilla-756abd66783344f5dcbb0a146d9281e027181837.tar.gz volse-hubzilla-756abd66783344f5dcbb0a146d9281e027181837.tar.bz2 volse-hubzilla-756abd66783344f5dcbb0a146d9281e027181837.zip |
add event export (this month) to event UI
Diffstat (limited to 'mod')
-rwxr-xr-x | mod/events.php | 12 |
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, |