event form - provide map ability for location field and add preview ability
This commit is contained in:
parent
0e74ebc6a9
commit
ed810a360f
@ -8,6 +8,8 @@ require_once('include/items.php');
|
|||||||
|
|
||||||
function events_post(&$a) {
|
function events_post(&$a) {
|
||||||
|
|
||||||
|
logger('post: ' . print_r($_REQUEST,true));
|
||||||
|
|
||||||
if(! local_channel())
|
if(! local_channel())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -178,6 +180,12 @@ function events_post(&$a) {
|
|||||||
$datarray['created'] = $created;
|
$datarray['created'] = $created;
|
||||||
$datarray['edited'] = $edited;
|
$datarray['edited'] = $edited;
|
||||||
|
|
||||||
|
if(intval($_REQUEST['preview'])) {
|
||||||
|
$html = format_event_html($datarray);
|
||||||
|
echo $html;
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
||||||
$event = event_store_event($datarray);
|
$event = event_store_event($datarray);
|
||||||
|
|
||||||
|
|
||||||
@ -597,6 +605,7 @@ function events_content(&$a) {
|
|||||||
'$t_orig' => $t_orig,
|
'$t_orig' => $t_orig,
|
||||||
'$sh_text' => t('Share this event'),
|
'$sh_text' => t('Share this event'),
|
||||||
'$sh_checked' => $sh_checked,
|
'$sh_checked' => $sh_checked,
|
||||||
|
'$preview' => t('Preview'),
|
||||||
'$permissions' => t('Permissions'),
|
'$permissions' => t('Permissions'),
|
||||||
'$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults),false)),
|
'$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults),false)),
|
||||||
'$submit' => t('Submit')
|
'$submit' => t('Submit')
|
||||||
|
@ -37,3 +37,7 @@
|
|||||||
#event-desc-text, #event-location-text, .event-form-location-end {
|
#event-desc-text, #event-location-text, .event-form-location-end {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#event-edit-preview-btn {
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
@ -6,12 +6,13 @@
|
|||||||
{{$desc}}
|
{{$desc}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form action="{{$post}}" method="post" >
|
<form id="event-edit-form" action="{{$post}}" method="post" >
|
||||||
|
|
||||||
<input type="hidden" name="event_id" value="{{$eid}}" />
|
<input type="hidden" name="event_id" value="{{$eid}}" />
|
||||||
<input type="hidden" name="event_hash" value="{{$event_hash}}" />
|
<input type="hidden" name="event_hash" value="{{$event_hash}}" />
|
||||||
<input type="hidden" name="xchan" value="{{$xchan}}" />
|
<input type="hidden" name="xchan" value="{{$xchan}}" />
|
||||||
<input type="hidden" name="mid" value="{{$mid}}" />
|
<input type="hidden" name="mid" value="{{$mid}}" />
|
||||||
|
<input type="hidden" name="preview" id="event-edit-preview" value="0" />
|
||||||
|
|
||||||
<div id="event-summary-text">{{$t_text}}</div>
|
<div id="event-summary-text">{{$t_text}}</div>
|
||||||
<input type="text" id="event-summary" name="summary" value="{{$t_orig}}" />{{$required}}
|
<input type="text" id="event-summary" name="summary" value="{{$t_orig}}" />{{$required}}
|
||||||
@ -138,17 +139,14 @@
|
|||||||
<button class="btn btn-default btn-xs" title="{{$edvideo}}" onclick="insertbbcomment('{{$comment}}','video', 'loc'); return false;">
|
<button class="btn btn-default btn-xs" title="{{$edvideo}}" onclick="insertbbcomment('{{$comment}}','video', 'loc'); return false;">
|
||||||
<i class="icon-facetime-video comment-icon"></i>
|
<i class="icon-facetime-video comment-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-default btn-xs" title="{{$mapper}}" onclick="insertbbcomment('{{$comment}}','map','loc'); return false;">
|
||||||
|
<i class="icon-globe comment-icon"></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="btn-group pull-right" id="comment-edit-submit-wrapper-loc">
|
|
||||||
{{if $preview}}
|
|
||||||
<button id="comment-edit-submit-loc" class="btn btn-default btn-xs" onclick="preview_comment(loc); return false;" title="{{$preview}}">
|
|
||||||
<i class="icon-eye-open comment-icon" ></i>
|
|
||||||
</button>
|
|
||||||
{{/if}}
|
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -168,10 +166,14 @@
|
|||||||
<div id="event-share-break"></div>
|
<div id="event-share-break"></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<button id="event-permissions-button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$permissions}}</button>
|
<button id="event-permissions-button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$permissions}}</button>
|
||||||
{{$acl}}
|
{{$acl}}
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
<button id="event-edit-preview-btn" class="btn btn-default btn-xs" title="{{$preview}}" onclick="doEventPreview(); return false;"><i class="icon-eye-open" ></i></button>
|
||||||
|
|
||||||
<input id="event-submit" type="submit" name="submit" value="{{$submit}}" />
|
<input id="event-submit" type="submit" name="submit" value="{{$submit}}" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -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() {
|
$(document).ready(function() {
|
||||||
$('#events-calendar').fullCalendar({
|
$('#events-calendar').fullCalendar({
|
||||||
events: '{{$baseurl}}/events/json/',
|
events: '{{$baseurl}}/events/json/',
|
||||||
|
Reference in New Issue
Block a user