diff options
author | Bart Visscher <bartv@thisnet.nl> | 2011-09-28 23:16:32 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-09-28 23:17:25 +0200 |
commit | 3f7d964acd5c83d62f91599ca95db55bdbbd8e69 (patch) | |
tree | d64cab59e365c0169368ae849fa4d4d2043a1d03 /apps/calendar/templates/part.getcal.php | |
parent | 45c983e899388d78bf9b9087aa40f894ca8cf74e (diff) | |
download | nextcloud-server-3f7d964acd5c83d62f91599ca95db55bdbbd8e69.tar.gz nextcloud-server-3f7d964acd5c83d62f91599ca95db55bdbbd8e69.zip |
Color event background with calendar color
Diffstat (limited to 'apps/calendar/templates/part.getcal.php')
-rw-r--r-- | apps/calendar/templates/part.getcal.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/calendar/templates/part.getcal.php b/apps/calendar/templates/part.getcal.php index 900a43b3df2..af29a3e369c 100644 --- a/apps/calendar/templates/part.getcal.php +++ b/apps/calendar/templates/part.getcal.php @@ -8,12 +8,16 @@ $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1); $events = array(); +$return = array('calendars'=>array()); foreach($calendars as $calendar) { $tmp = OC_Calendar_Object::all($calendar['id']); $events = array_merge($events, $tmp); + $return['calendars'][$calendar['id']] = array( + 'displayname' => $calendar['displayname'], + 'color' => $calendar['calendarcolor'] + ); } $select_year = $_GET["year"]; -$return_events = array(); $user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); foreach($events as $event) { @@ -44,14 +48,14 @@ foreach($events as $event) { $return_event['allday'] = true; } - if (isset($return_events[$year][$month][$day][$hour])) + if (isset($return[$year][$month][$day][$hour])) { - $return_events[$year][$month][$day][$hour][] = $return_event; + $return[$year][$month][$day][$hour][] = $return_event; } else { - $return_events[$year][$month][$day][$hour] = array(1 => $return_event); + $return[$year][$month][$day][$hour] = array(1 => $return_event); } } -OC_JSON::encodedPrint($return_events); +OC_JSON::encodedPrint($return); ?> |