From ed810a360f9a52e1e57ea95723d46b68eb586f69 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 9 Feb 2015 15:57:22 -0800 Subject: event form - provide map ability for location field and add preview ability --- mod/events.php | 9 +++++++++ view/css/mod_events.css | 4 ++++ view/tpl/event_form.tpl | 18 ++++++++++-------- view/tpl/event_head.tpl | 8 ++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/mod/events.php b/mod/events.php index 10affd4ec..144b9dd5e 100755 --- a/mod/events.php +++ b/mod/events.php @@ -8,6 +8,8 @@ require_once('include/items.php'); function events_post(&$a) { + logger('post: ' . print_r($_REQUEST,true)); + if(! local_channel()) return; @@ -178,6 +180,12 @@ function events_post(&$a) { $datarray['created'] = $created; $datarray['edited'] = $edited; + if(intval($_REQUEST['preview'])) { + $html = format_event_html($datarray); + echo $html; + killme(); + } + $event = event_store_event($datarray); @@ -597,6 +605,7 @@ function events_content(&$a) { '$t_orig' => $t_orig, '$sh_text' => t('Share this event'), '$sh_checked' => $sh_checked, + '$preview' => t('Preview'), '$permissions' => t('Permissions'), '$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults),false)), '$submit' => t('Submit') diff --git a/view/css/mod_events.css b/view/css/mod_events.css index e2439e844..f57c06a9d 100644 --- a/view/css/mod_events.css +++ b/view/css/mod_events.css @@ -36,4 +36,8 @@ #event-desc-text, #event-location-text, .event-form-location-end { margin-top: 15px; +} + +#event-edit-preview-btn { + margin-right: 15px; } \ No newline at end of file diff --git a/view/tpl/event_form.tpl b/view/tpl/event_form.tpl index 5ade55870..4f5736ddc 100755 --- a/view/tpl/event_form.tpl +++ b/view/tpl/event_form.tpl @@ -6,12 +6,13 @@ {{$desc}}

-
+ +
{{$t_text}}
{{$required}} @@ -138,17 +139,14 @@ + - + @@ -168,10 +166,14 @@
+ {{$acl}}
+ + +
diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl index 11dba2f9d..77e693b07 100755 --- a/view/tpl/event_head.tpl +++ b/view/tpl/event_head.tpl @@ -12,6 +12,14 @@ ); } + function doEventPreview() { + $('#event-edit-preview').val(1); + $.post('events',$('#event-edit-form').serialize(), function(data) { + $.colorbox({ html: data }); + }); + } + + $(document).ready(function() { $('#events-calendar').fullCalendar({ events: '{{$baseurl}}/events/json/', -- cgit v1.2.3