aboutsummaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--view/feedback-read.php5
-rw-r--r--view/feedback.php4
-rw-r--r--view/overview.php20
-rw-r--r--view/relive.php2
-rw-r--r--view/room.php4
-rw-r--r--view/schedule-json.php13
-rw-r--r--view/schedule.php2
7 files changed, 26 insertions, 24 deletions
diff --git a/view/feedback-read.php b/view/feedback-read.php
index 4f04a02..3c29dbd 100644
--- a/view/feedback-read.php
+++ b/view/feedback-read.php
@@ -1,9 +1,6 @@
<?php
-$feedback = new Feedback();
-if(!$feedback->isEnabled())
- throw new NotFoundException('Feedback is disabled');
-
+$feedback = $conference->getFeedback();
if(!$feedback->isLoggedIn())
{
$feedback->requestLogin();
diff --git a/view/feedback.php b/view/feedback.php
index c4ba146..cff9c8e 100644
--- a/view/feedback.php
+++ b/view/feedback.php
@@ -1,11 +1,11 @@
<?php
-$feedback = new Feedback();
-if(!$feedback->isEnabled())
+if(!$conference->hasFeedback())
throw new NotFoundException('Feedback is disabled');
$info = $_POST;
+$feedback = $conference->getFeedback();
if($feedback->validate($info))
{
$feedback->store($info);
diff --git a/view/overview.php b/view/overview.php
index 3b52e8f..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' => new Overview(),
+ 'overview' => $conference->getOverview(),
+
+ 'upcomingTalksPerRoom' => $upcomingTalksPerRoom,
));
diff --git a/view/relive.php b/view/relive.php
index e59f80c..cc8d682 100644
--- a/view/relive.php
+++ b/view/relive.php
@@ -1,6 +1,6 @@
<?php
-$relive = new Relive();
+$relive = $conference->getRelive();
if(!$relive->isEnabled())
throw new NotFoundException('Internal Relive is disabled');
diff --git a/view/room.php b/view/room.php
index 505be95..d586248 100644
--- a/view/room.php
+++ b/view/room.php
@@ -1,6 +1,6 @@
<?php
-$room = new Room($_GET['room']);
+$room = $conference->getRoom($_GET['room']);
$stream = $room->selectStream(
$_GET['selection'], $_GET['language']);
@@ -11,5 +11,5 @@ echo $tpl->render(array(
'room' => $room,
'stream' => $stream,
- 'schedule' => new Schedule(),
+ 'schedule' => $conference->getSchedule(),
));
diff --git a/view/schedule-json.php b/view/schedule-json.php
deleted file mode 100644
index 9aea603..0000000
--- a/view/schedule-json.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-$schedule = new Schedule();
-if(!$schedule->isEnabled())
- throw new NotFoundException('Schedule is disabled');
-
-header('Content-Type: application/json');
-
-if($conference->isClosed())
- echo '{}';
-
-else
- echo json_encode($schedule->getSchedule(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
diff --git a/view/schedule.php b/view/schedule.php
index 4b2746d..3a3d6db 100644
--- a/view/schedule.php
+++ b/view/schedule.php
@@ -5,5 +5,5 @@ echo $tpl->render(array(
'title' => 'Schedule-Übersicht',
'refresh' => 15*60,
- 'schedule' => new Schedule(),
+ 'schedule' => $conference->getSchedule(),
));