diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-07-26 22:44:49 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-07-26 22:44:49 -0700 |
commit | 85f546e691351efbab36da34be6e625c7198066a (patch) | |
tree | 9b0ad7ebaed5404257267f3cfa257de2de8f5c17 /mod/events.php | |
parent | 9e6aea73822741a742f4630e60629442dae5633b (diff) | |
download | volse-hubzilla-85f546e691351efbab36da34be6e625c7198066a.tar.gz volse-hubzilla-85f546e691351efbab36da34be6e625c7198066a.tar.bz2 volse-hubzilla-85f546e691351efbab36da34be6e625c7198066a.zip |
crude but more or less functional event import from thunderbird ics files
Diffstat (limited to 'mod/events.php')
-rwxr-xr-x | mod/events.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/mod/events.php b/mod/events.php index a3540ab0a..7fc4b26f2 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'] : ''); @@ -476,8 +490,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(); } |