aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-11-24 02:50:14 -0800
committerfriendica <info@friendica.com>2014-11-24 02:50:14 -0800
commit756abd66783344f5dcbb0a146d9281e027181837 (patch)
treed6f5bb45beddd4ded4edb3535712b989935a917a
parent53dc9cf2eb078f452979dc1dc9146ab993425621 (diff)
downloadvolse-hubzilla-756abd66783344f5dcbb0a146d9281e027181837.tar.gz
volse-hubzilla-756abd66783344f5dcbb0a146d9281e027181837.tar.bz2
volse-hubzilla-756abd66783344f5dcbb0a146d9281e027181837.zip
add event export (this month) to event UI
-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>