diff options
author | MaZderMind | 2016-12-20 23:12:48 +0100 |
---|---|---|
committer | MaZderMind | 2016-12-20 23:13:00 +0100 |
commit | 9f10efd6475eb9f25a75c35cc5780bee38c3c88e (patch) | |
tree | 87d3c3381ad39e9a6e5e73c9f2eeb792f6bf2ca2 | |
parent | 5ec71310d5ed6e1c4879506de7cae65ef1aab922 (diff) |
migrate v1 api to the new conferences accessors
Diffstat (limited to '')
-rw-r--r-- | view/streams-json-v1.php | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/view/streams-json-v1.php b/view/streams-json-v1.php index af0909b..7962226 100644 --- a/view/streams-json-v1.php +++ b/view/streams-json-v1.php @@ -2,23 +2,9 @@ header('Content-Type: application/json'); -$conferences = Conferences::getActiveConferences(); - -$struct = array(); -if(isset($GLOBALS['CONFIG'])) - $saved_config = $GLOBALS['CONFIG']; - -foreach ($conferences as $conference) +foreach (Conferences::getActiveConferences() as $conference) { - /* - ok. das ist so hacky. EIGENTLICH müsste man aus ModelBase - das $GLOBALS tilgen und von der api ne v2 releasen, welche - conferences als eigenes Objekt betrachtet - */ - $GLOBALS['CONFIG'] = $conference['CONFIG']; - $GLOBALS['MANDATOR'] = $conference['slug']; - - $overview = new Overview(); + $overview = $conference->getOverview(); foreach($overview->getGroups() as $group => $rooms) { @@ -99,14 +85,11 @@ foreach ($conferences as $conference) } $struct[] = array( - 'conference' => $conference['title'], + 'conference' => $conference->getTitle(), 'group' => $group, 'rooms' => $roomstruct, ); } } -if(isset($saved_config)) - $GLOBALS['CONFIG'] = $saved_config; - echo json_encode($struct, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |