Permalink
Browse files

Fix for issue #1 - Fullcalendar-js

The events are now escaped and formatted properly.
  • Loading branch information...
Cosmo Mathieu
Cosmo Mathieu committed Oct 27, 2015
1 parent 049e9c8 commit 442355fb3c73fd6a5d14ed104e42f59315705e7b
Showing with 17 additions and 7 deletions.
  1. +17 −7 application/modules/calendar/plugin.php
@@ -124,13 +124,23 @@ public function javascript()
$result = $query->result();
foreach($result as $key => $val) {
$events .= "{
title: '". $val->title ."',
url: '". site_url() . "calendar/" . $val->id . "-" . date("Y-m-d", strtotime($val->created)) ."',
start: '". $val->start ."',
end: '". $val->end ."',
description: '". shorten_phrase( $val->description, 50 ) ."'
},";
// $events .= "{
// title: '". $val->title ."',
// url: '". site_url() . "calendar/" . $val->id . "-" . date("Y-m-d", strtotime($val->created)) ."',
// start: '". $val->start ."',
// end: '". $val->end ."',
// description: '". shorten_phrase( $val->description, 50 ) ."'
// },";
$events .= json_encode(
array(
'title' => $val->title,
'url' => site_url() . "calendar/" . $val->id . "-" . date("Y-m-d", strtotime($val->created)),
'start' => $val->start,
'end' => $val->end,
'description' => shorten_phrase( $val->description, 50 )
)
);
$events .= ',';
}
$output = '';

0 comments on commit 442355f

Please sign in to comment.