aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmod/events.php12
-rw-r--r--version.inc2
-rwxr-xr-xview/tpl/events-js.tpl1
3 files changed, 14 insertions, 1 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,
diff --git a/version.inc b/version.inc
index 67edf7654..b6da826d4 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-11-23.868
+2014-11-24.869
diff --git a/view/tpl/events-js.tpl b/view/tpl/events-js.tpl
index 69a248512..ad41e983a 100755
--- a/view/tpl/events-js.tpl
+++ b/view/tpl/events-js.tpl
@@ -2,6 +2,7 @@
<div class="generic-content-wrapper-styled">
<h2>{{$title}}</h2>
+<div id="export-event-link"><a href="{{$export.0}}" >{{$export.1}}</a></div>
<div id="new-event-link"><a href="{{$new_event.0}}" >{{$new_event.1}}</a></div>
<div id="events-calendar"></div>