diff options
Diffstat (limited to 'modules-available/locationinfo/api.inc.php')
-rw-r--r-- | modules-available/locationinfo/api.inc.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php index e04e7e65..1b4f9d59 100644 --- a/modules-available/locationinfo/api.inc.php +++ b/modules-available/locationinfo/api.inc.php @@ -90,8 +90,16 @@ function getCalendar($idList) { foreach ($serverList as $server) { $serverInstance = CourseBackend::getInstance($server['type']); $serverInstance->setCredentials(json_encode($server['credentials']), $server['serverurl'], $server['serverid']); - $calendarFromBackend = json_decode($serverInstance->fetchSchedule($server['idList']), true); - $resultarray = array_merge($resultarray, $calendarFromBackend); + $calendarFromBackend = $serverInstance->fetchSchedule($server['idList']); + + $formattedArray = array(); + foreach ($calendarFromBackend as $key => $value) { + $y['id'] = $key; + $y['calendar'] = $value; + $formattedArray[] = $y; + } + + $resultarray = array_merge($resultarray, $formattedArray); } echo json_encode($resultarray, true); |