mirror of
https://github.com/voc/streaming-website
synced 2024-11-10 06:34:17 +00:00
1cd3e2b60b
PHP8 deprecated, that class member variables can be created outside the class definition or constructor, which prevented the code to run at all. Additionally the error handling has changed, which has lead to multiple other errors during the runtime. Finally, strftime was deprecated in PHP 8.1.
56 lines
826 B
PHP
56 lines
826 B
PHP
<?php
|
|
|
|
class RoomTab
|
|
{
|
|
public $room;
|
|
public $tab;
|
|
|
|
public function __construct(Room $room, $tab)
|
|
{
|
|
$this->room = $room;
|
|
$this->tab = $tab;
|
|
}
|
|
|
|
public function getRoom()
|
|
{
|
|
return $this->room;
|
|
}
|
|
|
|
public function getTab()
|
|
{
|
|
return $this->tab;
|
|
}
|
|
|
|
public function getLink()
|
|
{
|
|
$path = [$this->getRoom()->getConference()->getSlug(), $this->getRoom()->getSlug()];
|
|
|
|
$tabs = $this->getRoom()->getTabNames();
|
|
if($tabs[0] != $this->getTab())
|
|
$path[] = $this->getTab();
|
|
|
|
return joinpath($path).url_params();
|
|
}
|
|
|
|
public function getDisplay()
|
|
{
|
|
$tab = $this->getTab();
|
|
switch($tab)
|
|
{
|
|
case 'music':
|
|
return 'Radio';
|
|
|
|
case 'video':
|
|
return 'Video (Legacy)';
|
|
|
|
case 'slides':
|
|
return 'Slides (Legacy)';
|
|
|
|
case 'dash':
|
|
return 'Video';
|
|
|
|
default:
|
|
return ucfirst($tab);
|
|
}
|
|
}
|
|
}
|