aboutsummaryrefslogtreecommitdiffstats
path: root/mod/events.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-07-29 22:04:07 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-07-29 22:04:07 +0200
commit98fa996b3f5125b60e2653bca2218b08041ad6a4 (patch)
tree685c3909ac49f7a25cd39877f74ed56ada9b15e0 /mod/events.php
parent07e890a79a5c506b2e32272edf86ad4aba3b8fba (diff)
parentcbb6d37b6ca7e5d9e476fd3e7bea3ba56d3271e1 (diff)
downloadvolse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.tar.gz
volse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.tar.bz2
volse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/events.php')
-rwxr-xr-xmod/events.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/mod/events.php b/mod/events.php
index a89bbb760..0af81278f 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -13,6 +13,20 @@ function events_post(&$a) {
if(! local_channel())
return;
+ if(($_FILES) && array_key_exists('userfile',$_FILES) && intval($_FILES['userfile']['size'])) {
+ $src = $_FILES['userfile']['tmp_name'];
+ if($src) {
+ $result = parse_ical_file($src,local_channel());
+ if($result)
+ info( t('Calendar entries imported.') . EOL);
+ else
+ notice( t('No calendar entries found.') . EOL);
+ @unlink($src);
+ }
+ goaway(z_root() . '/events');
+ }
+
+
$event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0);
$event_hash = ((x($_POST,'event_hash')) ? $_POST['event_hash'] : '');
@@ -148,10 +162,9 @@ function events_post(&$a) {
}
}
else {
- // Note: do not set `private` field for self-only events. It will
- // keep even you from seeing them!
$str_contact_allow = '<' . $channel['channel_hash'] . '>';
$str_group_allow = $str_contact_deny = $str_group_deny = '';
+ $private_event = true;
}
}
@@ -451,6 +464,7 @@ function events_content(&$a) {
if($export) {
header('Content-type: text/calendar');
+ header('content-disposition: attachment; filename="' . t('calendar') . '-' . $channel['channel_address'] . '.ics"' );
echo ical_wrapper($r);
killme();
}
@@ -477,8 +491,8 @@ function events_content(&$a) {
'$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''),
'$calendar' => cal($y,$m,$links, ' eventcal'),
'$events' => $events,
-
-
+ '$upload' => t('Upload'),
+ '$submit' => t('Submit')
));
if (x($_GET,'id')){ echo $o; killme(); }