diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-11-28 16:26:24 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-11-28 16:26:24 +0100 |
commit | 17907f11a350536bbcac248e6b81b63eecee964d (patch) | |
tree | 93f8413b78c6fb12fde059ecc8f8831e9996731a /include/text.php | |
parent | cb7df797e1d5a87ff8b6dbb6c07faf68e3e725f7 (diff) | |
parent | 122d7281f7d4b55ef8adf8791bdab51b4b797ba8 (diff) | |
download | volse-hubzilla-17907f11a350536bbcac248e6b81b63eecee964d.tar.gz volse-hubzilla-17907f11a350536bbcac248e6b81b63eecee964d.tar.bz2 volse-hubzilla-17907f11a350536bbcac248e6b81b63eecee964d.zip |
Merge remote-tracking branch 'upstream/master'
Conflicts:
include/datetime.php
include/text.php
mod/events.php
version.inc
view/css/mod_events.css
view/theme/redbasic/css/style.css
view/tpl/event_head.tpl
view/tpl/events-js.tpl
view/tpl/jot.tpl
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index f40d67f23..99c73ebee 100644 --- a/include/text.php +++ b/include/text.php @@ -1381,7 +1381,37 @@ function generate_named_map($location) { return (($arr['html']) ? $arr['html'] : $location); } +function format_event($jobject) { + $event = array(); + + $object = json_decode($jobject,true); + + //ensure compatibility with older items - this check can be removed at a later point + 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'] = replace_macros(get_markup_template('event_item_header.tpl'),array( + '$title' => bbcode($object['title']), + '$dtstart_label' => t('Starts:'), + '$dtstart_title' => datetime_convert('UTC', 'UTC', $object['start'], (($object['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )), + '$dtstart_dt' => (($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))), + '$finish' => (($object['nofinish']) ? false : true), + '$dtend_label' => t('Finishes:'), + '$dtend_title' => datetime_convert('UTC','UTC',$object['finish'], (($object['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )), + '$dtend_dt' => (($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 ))) + )); + + $event['content'] = replace_macros(get_markup_template('event_item_content.tpl'),array( + '$description' => bbcode($object['description']), + '$location_label' => t('Location:'), + '$location' => bbcode($object['location']) + )); + + } + return $event; +} function prepare_body(&$item,$attach = false) { require_once('include/identity.php'); @@ -1414,6 +1444,7 @@ function prepare_body(&$item,$attach = false) { } } +<<<<<<< HEAD $event = array(); $is_event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? true : false); @@ -1462,6 +1493,13 @@ function prepare_body(&$item,$attach = false) { $prep_arr = array( 'item' => $item, 'html' => $is_event ? $event['content'] : $s, +======= + $event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event($item['object']) : false); + + $prep_arr = array( + 'item' => $item, + 'html' => $event ? $event['content'] : $s, +>>>>>>> upstream/master 'event' => $event['header'], 'photo' => $photo ); |