aboutsummaryrefslogtreecommitdiffstats
path: root/mod/events.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-02-14 16:48:34 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2012-02-14 16:48:34 +0100
commit7140e56d1f01ce8448fa432411c10b9212fc8a66 (patch)
tree83c837017a0a1c9eaa82f92f2d1f5e9e457df63b /mod/events.php
parent549c920e6f0e1bf6c92dc13d7903173fabbb88ff (diff)
downloadvolse-hubzilla-7140e56d1f01ce8448fa432411c10b9212fc8a66.tar.gz
volse-hubzilla-7140e56d1f01ce8448fa432411c10b9212fc8a66.tar.bz2
volse-hubzilla-7140e56d1f01ce8448fa432411c10b9212fc8a66.zip
events js: pass only first line of desc as title; item.desc and item.location as html
Diffstat (limited to 'mod/events.php')
-rwxr-xr-xmod/events.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/mod/events.php b/mod/events.php
index 731b824de..e10f508dd 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -241,10 +241,8 @@ function events_content(&$a) {
$start = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'c') : datetime_convert('UTC','UTC',$rr['start'],'c'));
if ($rr['nofinish']){
$end = null;
- $allday=true;
} else {
$end = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['finish'], 'c') : datetime_convert('UTC','UTC',$rr['finish'],'c'));
- $allday=false;
}
@@ -253,26 +251,31 @@ function events_content(&$a) {
$last_date = $d;
$edit = ((! $rr['cid']) ? array($a->get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null);
+ list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
+ $title = strip_tags($title);
+ $html = format_event_html($rr);
+ $rr['desc'] = bbcode($rr['desc']);
+ $rr['location'] = bbcode($rr['location']);
$events[] = array(
'id'=>$rr['id'],
'start'=> $start,
'end' => $end,
- 'allDay' => $allday,
- 'title' => strip_tags(bbcode($rr['desc'])),
+ 'allDay' => false,
+ 'title' => $title,
'j' => $j,
'd' => $d,
'edit' => $edit,
'is_first'=>$is_first,
'item'=>$rr,
- 'html'=>format_event_html($rr),
+ 'html'=>$html,
'plink' => array($rr['plink'],t('link to source'),'',''),
);
}
}
-
+
if ($a->argv[1] === 'json'){
echo json_encode($events); killme();
}