From f6c0270d40f6730fe1e1820f2866b08792df1db6 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 10 Dec 2016 18:22:34 +0100 Subject: rewrite data-model so that every configuration option is accessed through the conference --- model/Subtitles.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'model/Subtitles.php') diff --git a/model/Subtitles.php b/model/Subtitles.php index e1878f2..1d401b8 100644 --- a/model/Subtitles.php +++ b/model/Subtitles.php @@ -1,14 +1,25 @@ conference = $conference; + } + + public function getConference() { + return $this->conference; + } + public function isEnabled() { - return $this->has('SUBTITLES'); + return $this->getConference()->has('SUBTITLES'); } public function getEnabledRooms($slug) { $rooms = []; - foreach(Room::rooms() as $room) + foreach($this->getConference()->getOverview()->getRooms() as $room) { if($room->hasSubtitles()) $rooms[] = $room; @@ -18,9 +29,9 @@ class Subtitles extends ModelBase } public function getPrimusURL() { - return $this->get('SUBTITLES.PRIMUS_URL'); + return $this->getConference()->get('SUBTITLES.PRIMUS_URL'); } public function getFrontendURL() { - return $this->get('SUBTITLES.FRONTEND_URL'); + return $this->getConference()->get('SUBTITLES.FRONTEND_URL'); } } -- cgit v1.2.3