From a439f454df31093157aaa773e549f5bacc5584c1 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 20 Dec 2015 15:29:09 +0100 Subject: implement new subtitles L2S2 interface --- model/Room.php | 10 ++++++++++ model/Subtitles.php | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 model/Subtitles.php (limited to 'model') diff --git a/model/Room.php b/model/Room.php index 124d057..b4fc1d1 100644 --- a/model/Room.php +++ b/model/Room.php @@ -76,6 +76,16 @@ class Room extends ModelBase return $this->get('ROOMS.'.$this->getSlug().'.SCHEDULE') && $this->has('SCHEDULE'); } + public function hasSubtitles() { + return + $this->get('ROOMS.'.$this->getSlug().'.SUBTITLES') && + $this->has('ROOMS.'.$this->getSlug().'.SUBTITLES_ROOM_ID') && + $this->has('SUBTITLES'); + } + public function getSubtitlesRoomId() { + return $this->get('ROOMS.'.$this->getSlug().'.SUBTITLES_ROOM_ID'); + } + public function hasFeedback() { return $this->get('ROOMS.'.$this->getSlug().'.FEEDBACK') && $this->has('FEEDBACK'); } diff --git a/model/Subtitles.php b/model/Subtitles.php new file mode 100644 index 0000000..e1878f2 --- /dev/null +++ b/model/Subtitles.php @@ -0,0 +1,26 @@ +has('SUBTITLES'); + } + + public function getEnabledRooms($slug) { + $rooms = []; + foreach(Room::rooms() as $room) + { + if($room->hasSubtitles()) + $rooms[] = $room; + } + + return $rooms; + } + + public function getPrimusURL() { + return $this->get('SUBTITLES.PRIMUS_URL'); + } + public function getFrontendURL() { + return $this->get('SUBTITLES.FRONTEND_URL'); + } +} -- cgit v1.2.3