aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/bb2diaspora.php21
-rwxr-xr-xmod/events.php9
-rw-r--r--mod/import.php2
-rw-r--r--view/css/mod_events.css4
-rwxr-xr-xview/tpl/event_form.tpl18
-rwxr-xr-xview/tpl/event_head.tpl8
6 files changed, 34 insertions, 28 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 5c93ac3aa..fa3aa3aa2 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -271,22 +271,6 @@ function bb2diaspora_itemwallwall(&$item) {
. $item['body'];
}
- // We have to do something similar for wall-to-wall comments. ITEM_WALL|ITEM_ORIGIN indicates that it was posted on this site.
- // Regular matrix comments may have one of these bits set, but not both.
-
- // Update: this is getting triggered way too often and unnecessarily. Commenting out until we find a better solution.
- // It's not an easy problem. For now we'll live with the mis-attributions, as wall to wall comments are much less frequent
- // than wall-to-wall posts.
-
-// if(($item['mid'] != $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (($item['item_flags'] & (ITEM_WALL|ITEM_ORIGIN)) == (ITEM_WALL|ITEM_ORIGIN)) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) {
-// logger('bb2diaspora_itemwallwall: wall to wall comment',LOGGER_DEBUG);
- // post will come across with the owner's identity. Throw a preamble onto the post to indicate the true author.
-// $item['body'] = "\n\n"
-// . '[img]' . $item['author']['xchan_photo_m'] . '[/img]'
-// . '[url=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/url]' . "\n\n"
-// . $item['body'];
-// }
-
// $item['author'] might cause a surprise further down the line if it wasn't expected to be here.
if(! $author_exists)
@@ -311,8 +295,6 @@ function bb2diaspora_itembody($item,$force_update = false) {
logger('bb2diaspora_itembody: cached ');
$newitem = $item;
$newitem['body'] = $meta['body'];
-// this won't work - the post is now in markdown
-// bb2diaspora_itemwallwall($newitem);
return $newitem['body'];
}
}
@@ -333,7 +315,8 @@ function bb2diaspora_itembody($item,$force_update = false) {
bb2diaspora_itemwallwall($newitem);
- $body = preg_replace('/\#\^http/i', 'http', $newitem['body']);
+ $title = $newitem['title'];
+ $body = preg_replace('/\#\^http/i', 'http', $newitem['body']);
// protect tags and mentions from hijacking
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/mod/import.php b/mod/import.php
index c9a4edb67..088c5cb61 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -250,7 +250,7 @@ function import_post(&$a) {
if($seize) {
- // replace our existing xchan if we're seizing control
+ // replace any existing xchan we may have on this site if we're seizing control
$r = q("delete from xchan where xchan_hash = '%s'",
dbesc($channel['channel_hash'])
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}}
</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_hash" value="{{$event_hash}}" />
<input type="hidden" name="xchan" value="{{$xchan}}" />
<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>
<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;">
<i class="icon-facetime-video comment-icon"></i>
</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 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>
@@ -168,10 +166,14 @@
<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>
{{$acl}}
<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}}" />
</form>
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/',