diff options
Diffstat (limited to '')
-rw-r--r-- | model/Room.php | 70 | ||||
-rw-r--r-- | model/RoomSelection.php | 6 | ||||
-rw-r--r-- | model/Stream.php | 6 | ||||
-rw-r--r-- | view/embed.php | 12 | ||||
-rw-r--r-- | view/room.php | 2 |
5 files changed, 48 insertions, 48 deletions
diff --git a/model/Room.php b/model/Room.php index dd63038..24d87cb 100644 --- a/model/Room.php +++ b/model/Room.php @@ -179,35 +179,35 @@ class Room return $this->getConference()->get('ROOMS.'.$this->getSlug().'.TRANSLATION'); } - private function getTranslationEndpoints() { - return array_map( - function ($translation) { - return $translation['endpoint']; - }, - $this->getTranslations() - ); - } - - private function isTranslationEndpoint($endpoint) { - return in_array($endpoint, $this->getTranslationEndpoints()); - } - - private function findTranslationLabel($language) { - foreach($this->getTranslations() as $translation) { - if ($translation['endpoint'] === $language) { - return $translation['label']; - } - } - return null; - } + private function getTranslationEndpoints() { + return array_map( + function ($translation) { + return $translation['endpoint']; + }, + $this->getTranslations() + ); + } + + private function isTranslationEndpoint($endpoint) { + return in_array($endpoint, $this->getTranslationEndpoints()); + } + + private function findTranslationLabel($language) { + foreach($this->getTranslations() as $translation) { + if ($translation['endpoint'] === $language) { + return $translation['label']; + } + } + return null; + } public function hasTranslation() { return count($this->getTranslations()) > 0; } - public function isValidLanguage($language) { - return ($language === 'native' || $this->isTranslationEndpoint($language)); - } + public function isValidLanguage($language) { + return ($language === 'native' || $this->isTranslationEndpoint($language)); + } public function getSelectionNames() { @@ -343,17 +343,17 @@ class Room if(!in_array($selection, $selections)) throw new NotFoundException('Selection '.$selection.' in Room '.$this->getSlug()); - $translation_label = null; - if ($language !== 'native' && $language !== 'stereo') { - if (! $this->hasTranslation()) { - throw new NotFoundException('Translated Streams of Room '. $this->getSlug()); - } - if (! $this->isValidLanguage($language)) { - throw new NotFoundException('Selected translation'); - } - - $translation_label = $this->findTranslationLabel($language); - } + $translation_label = null; + if ($language !== 'native' && $language !== 'stereo') { + if (! $this->hasTranslation()) { + throw new NotFoundException('Translated Streams of Room '. $this->getSlug()); + } + if (! $this->isValidLanguage($language)) { + throw new NotFoundException('Selected translation'); + } + + $translation_label = $this->findTranslationLabel($language); + } return $this->createStreamObject($selection, $language, $translation_label); } diff --git a/model/RoomSelection.php b/model/RoomSelection.php index a83b5c6..c21ea7e 100644 --- a/model/RoomSelection.php +++ b/model/RoomSelection.php @@ -18,15 +18,15 @@ class RoomSelection return $this->selection; } - private function getSelectionPath() { + private function getSelectionPath() { $path = [$this->getRoom()->getConference()->getSlug(), $this->getRoom()->getSlug()]; $selection = $this->getRoom()->getSelectionNames(); if ($selection[0] != $this->getSelection()) $path[] = $this->getSelection(); - return joinpath($path); - } + return joinpath($path); + } public function getLink() { diff --git a/model/Stream.php b/model/Stream.php index 28cb0f8..99abaf1 100644 --- a/model/Stream.php +++ b/model/Stream.php @@ -32,9 +32,9 @@ class Stream public function isTranslated() { - return !empty($this->getLanguage()) && - $this->getLanguage() !== 'native' && - $this->getLanguage() !== 'stereo'; + return !empty($this->getLanguage()) && + $this->getLanguage() !== 'native' && + $this->getLanguage() !== 'stereo'; } public function getVideoSize() diff --git a/view/embed.php b/view/embed.php index aaf203d..97df148 100644 --- a/view/embed.php +++ b/view/embed.php @@ -9,13 +9,13 @@ $selection = $_GET['selection']; $language = $_GET['language']; if ($language !== 'native' && $language !== 'stereo') { - if (! $room->hasTranslation()) { - throw new NotFoundException('Not translated'); - } + if (! $room->hasTranslation()) { + throw new NotFoundException('Not translated'); + } - if (! $room->isValidLanguage($language)) { - throw new NotFoundException('Language not found'); - } + if (! $room->isValidLanguage($language)) { + throw new NotFoundException('Language not found'); + } } $stream = $room->selectStream($selection, $language); diff --git a/view/room.php b/view/room.php index c63f9ec..d035219 100644 --- a/view/room.php +++ b/view/room.php @@ -5,7 +5,7 @@ $selection = $_GET['selection']; $language = $_GET['language']; if (! $room->isValidLanguage($language)) { - throw new NotFoundException('Language not found'); + throw new NotFoundException('Language not found'); } $stream = $room->selectStream($selection, $language); |