diff options
author | MaZderMind | 2016-12-18 13:32:10 +0100 |
---|---|---|
committer | MaZderMind | 2016-12-18 13:32:10 +0100 |
commit | 340fdecd903fedee4dc39cfc60c166122f2451e1 (patch) | |
tree | be89253bbf80fc8383311137761a8a472e5d8b40 /view/overview.php | |
parent | 46634852dc1af3fe53136a2d48bc3157e3bbad62 (diff) | |
parent | 35e7a2b2adad42b077de60d1566c22da62edeb77 (diff) |
Merge branch 'feature/33-remove-schedule-ajax-from-startpage'
fixes #33
Diffstat (limited to '')
-rw-r--r-- | view/overview.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/view/overview.php b/view/overview.php index 93cf007..adc8d5f 100644 --- a/view/overview.php +++ b/view/overview.php @@ -1,8 +1,26 @@ <?php +$schedule = $conference->getSchedule(); + +$talksPerRoom = $schedule->getSchedule(); +$now = time() + $schedule->getSimulationOffset(); + +$upcomingTalksPerRoom = array_map(function($talks) use($now) { + return [ + 'current' => array_filter_last($talks, function($talk) use ($now) { + return $talk['start'] < $now && $talk['end'] > $now; + }), + 'next' => array_filter_first($talks, function($talk) use ($now) { + return !isset($talk['special']) && $talk['start'] > $now; + }), + ]; +}, $talksPerRoom); + echo $tpl->render(array( 'page' => 'overview', 'title' => 'Live-Streams', 'overview' => $conference->getOverview(), + + 'upcomingTalksPerRoom' => $upcomingTalksPerRoom, )); |