first iteration on the event item
This commit is contained in:
parent
41542e6886
commit
c7cbd41c16
@ -346,6 +346,7 @@ class Item extends BaseObject {
|
|||||||
'owner_photo' => $this->get_owner_photo(),
|
'owner_photo' => $this->get_owner_photo(),
|
||||||
'owner_name' => $this->get_owner_name(),
|
'owner_name' => $this->get_owner_name(),
|
||||||
'photo' => $body['photo'],
|
'photo' => $body['photo'],
|
||||||
|
'event' => $body['event'],
|
||||||
'has_tags' => $has_tags,
|
'has_tags' => $has_tags,
|
||||||
|
|
||||||
// Item toolbar buttons
|
// Item toolbar buttons
|
||||||
|
@ -697,6 +697,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
|
|||||||
'thumb' => $profile_avatar,
|
'thumb' => $profile_avatar,
|
||||||
'title' => $item['title'],
|
'title' => $item['title'],
|
||||||
'body' => $body['html'],
|
'body' => $body['html'],
|
||||||
|
'event' => $body['event'],
|
||||||
'photo' => $body['photo'],
|
'photo' => $body['photo'],
|
||||||
'tags' => $body['tags'],
|
'tags' => $body['tags'],
|
||||||
'categories' => $body['categories'],
|
'categories' => $body['categories'],
|
||||||
|
@ -787,6 +787,11 @@ function event_store_item($arr, $event) {
|
|||||||
'type' => ACTIVITY_OBJ_EVENT,
|
'type' => ACTIVITY_OBJ_EVENT,
|
||||||
'id' => z_root() . '/event/' . $r[0]['resource_id'],
|
'id' => z_root() . '/event/' . $r[0]['resource_id'],
|
||||||
'title' => $arr['summary'],
|
'title' => $arr['summary'],
|
||||||
|
'start' => $arr['start'],
|
||||||
|
'finish' => $arr['finish'],
|
||||||
|
'description' => $arr['description'],
|
||||||
|
'location' => $arr['location'],
|
||||||
|
'adjust' => $arr['adjust'],
|
||||||
'content' => format_event_bbcode($arr),
|
'content' => format_event_bbcode($arr),
|
||||||
'author' => array(
|
'author' => array(
|
||||||
'name' => $r[0]['xchan_name'],
|
'name' => $r[0]['xchan_name'],
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
require_once("include/template_processor.php");
|
require_once("include/template_processor.php");
|
||||||
require_once("include/smarty.php");
|
require_once("include/smarty.php");
|
||||||
|
require_once("include/bbcode.php");
|
||||||
|
|
||||||
// random string, there are 86 characters max in text mode, 128 for hex
|
// random string, there are 86 characters max in text mode, 128 for hex
|
||||||
// output is urlsafe
|
// output is urlsafe
|
||||||
@ -1413,9 +1414,55 @@ function prepare_body(&$item,$attach = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$event = array();
|
||||||
|
$is_event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? true : false);
|
||||||
|
|
||||||
|
if($is_event) {
|
||||||
|
$object = json_decode($item['object'],true);
|
||||||
|
|
||||||
|
//ensure compatibility with older items
|
||||||
|
if(array_key_exists('description', $object)) {
|
||||||
|
|
||||||
|
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8:01 AM
|
||||||
|
|
||||||
|
$event['header'] = '<div class="event-title"><h3><i class="icon-calendar"></i> ' . bbcode($object['title']) . '</h3></div>' . "\r\n";
|
||||||
|
|
||||||
|
$event['header'] .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span> <span class="dtstart" title="'
|
||||||
|
. datetime_convert('UTC', 'UTC', $object['start'], (($object['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' ))
|
||||||
|
. '" >'
|
||||||
|
. (($object['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),
|
||||||
|
$object['start'] , $bd_format ))
|
||||||
|
: day_translate(datetime_convert('UTC', 'UTC',
|
||||||
|
$object['start'] , $bd_format)))
|
||||||
|
. '</span></div>' . "\r\n";
|
||||||
|
|
||||||
|
if(! $object['nofinish'])
|
||||||
|
$event['header'] .= '<div class="event-end" ><span class="event-label">' . t('Finishes:') . '</span> <span class="dtend" title="'
|
||||||
|
. datetime_convert('UTC','UTC',$object['finish'], (($object['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' ))
|
||||||
|
. '" >'
|
||||||
|
. (($object['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),
|
||||||
|
$object['finish'] , $bd_format ))
|
||||||
|
: day_translate(datetime_convert('UTC', 'UTC',
|
||||||
|
$object['finish'] , $bd_format )))
|
||||||
|
. '</span></div>' . "\r\n";
|
||||||
|
|
||||||
|
|
||||||
|
$event['content'] = '<div class="event-description">' . bbcode($object['description']) . '</div>' . "\r\n";
|
||||||
|
|
||||||
|
if(strlen($object['location']))
|
||||||
|
$event['content'] .= '<div class="event-location"><span class="event-label"> ' . t('Location:') . '</span> <span class="location">'
|
||||||
|
. bbcode($object['location'])
|
||||||
|
. '</span></div>' . "\r\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$is_event = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$prep_arr = array(
|
$prep_arr = array(
|
||||||
'item' => $item,
|
'item' => $item,
|
||||||
'html' => $s,
|
'html' => $is_event ? $event['content'] : $s,
|
||||||
|
'event' => $event['header'],
|
||||||
'photo' => $photo
|
'photo' => $photo
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1423,6 +1470,7 @@ function prepare_body(&$item,$attach = false) {
|
|||||||
|
|
||||||
$s = $prep_arr['html'];
|
$s = $prep_arr['html'];
|
||||||
$photo = $prep_arr['photo'];
|
$photo = $prep_arr['photo'];
|
||||||
|
$event = $prep_arr['event'];
|
||||||
|
|
||||||
// q("update item set html = '%s' where id = %d",
|
// q("update item set html = '%s' where id = %d",
|
||||||
// dbesc($s),
|
// dbesc($s),
|
||||||
@ -1489,6 +1537,7 @@ function prepare_body(&$item,$attach = false) {
|
|||||||
'item' => $item,
|
'item' => $item,
|
||||||
'photo' => $photo,
|
'photo' => $photo,
|
||||||
'html' => $s,
|
'html' => $s,
|
||||||
|
'event' => $event,
|
||||||
'categories' => $categories,
|
'categories' => $categories,
|
||||||
'folders' => $filer,
|
'folders' => $filer,
|
||||||
'tags' => $tags,
|
'tags' => $tags,
|
||||||
|
@ -249,11 +249,10 @@ a.wall-item-name-link {
|
|||||||
/* event item */
|
/* event item */
|
||||||
|
|
||||||
.event-title h3 {
|
.event-title h3 {
|
||||||
|
margin: 0px 0px 10px 0px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-title,
|
|
||||||
.event-end,
|
|
||||||
.event-description {
|
.event-description {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
@ -857,6 +857,15 @@ nav .acpopup {
|
|||||||
border-color: #ccc !important;
|
border-color: #ccc !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wall-event-item {
|
||||||
|
padding: 10px;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #3A87AD; /* should reflect calendar color */
|
||||||
|
border-top-left-radius: $radiuspx;
|
||||||
|
border-top-right-radius: $radiuspx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#event-summary-text {
|
#event-summary-text {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
@ -1242,14 +1251,14 @@ a.rconnect:hover, a.rateme:hover, div.rateme:hover {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
/* display: block; */
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-sub-text {
|
.dropdown-sub-text {
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
/* display: block; */
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notify-seen a {
|
.notify-seen a {
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
{{$item.photo}}
|
{{$item.photo}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $item.event}}
|
||||||
|
<div class="wall-event-item" id="wall-event-item-{{$item.id}}">
|
||||||
|
{{$item.event}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
<div class="wall-item-head">
|
<div class="wall-item-head">
|
||||||
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
|
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
|
||||||
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
|
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
{{$item.photo}}
|
{{$item.photo}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $item.event}}
|
||||||
|
<div class="wall-event-item" id="wall-event-item-{{$item.id}}">
|
||||||
|
{{$item.event}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
<div class="wall-item-head">
|
<div class="wall-item-head">
|
||||||
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
|
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
|
||||||
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
|
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
|
||||||
|
@ -7,6 +7,11 @@
|
|||||||
{{$item.photo}}
|
{{$item.photo}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $item.event}}
|
||||||
|
<div class="wall-event-item" id="wall-event-item-{{$item.id}}">
|
||||||
|
{{$item.event}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
<div class="wall-item-head">
|
<div class="wall-item-head">
|
||||||
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
|
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
|
||||||
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
|
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
|
||||||
|
Reference in New Issue
Block a user