add event export (this month) to event UI
This commit is contained in:
parent
53dc9cf2eb
commit
756abd6678
@ -275,6 +275,11 @@ function events_content(&$a) {
|
|||||||
if(! $m)
|
if(! $m)
|
||||||
$m = intval($thismonth);
|
$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.
|
// 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.
|
// 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'){
|
if ($a->argv[1] === 'json'){
|
||||||
echo json_encode($events); killme();
|
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'),'',''),
|
'$new_event'=> array($a->get_baseurl().'/events/new',t('Create New Event'),'',''),
|
||||||
'$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''),
|
'$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''),
|
||||||
'$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''),
|
'$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'),
|
'$calendar' => cal($y,$m,$links, ' eventcal'),
|
||||||
'$events' => $events,
|
'$events' => $events,
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
2014-11-23.868
|
2014-11-24.869
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<div class="generic-content-wrapper-styled">
|
<div class="generic-content-wrapper-styled">
|
||||||
<h2>{{$title}}</h2>
|
<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="new-event-link"><a href="{{$new_event.0}}" >{{$new_event.1}}</a></div>
|
||||||
|
|
||||||
<div id="events-calendar"></div>
|
<div id="events-calendar"></div>
|
||||||
|
Reference in New Issue
Block a user