mirror of
https://github.com/voc/streaming-website
synced 2024-11-10 06:34:17 +00:00
Leading Spaces to Tabs
This commit is contained in:
parent
46852c4f9c
commit
0b73843d5e
5 changed files with 46 additions and 46 deletions
|
@ -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 getTranslationEndpoints() {
|
||||
return array_map(
|
||||
function ($translation) {
|
||||
return $translation['endpoint'];
|
||||
},
|
||||
$this->getTranslations()
|
||||
);
|
||||
}
|
||||
|
||||
private function isTranslationEndpoint($endpoint) {
|
||||
return in_array($endpoint, $this->getTranslationEndpoints());
|
||||
}
|
||||
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 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);
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue