aboutsummaryrefslogtreecommitdiff
path: root/model/RoomTab.php
blob: 4848f578e94bef13f3da942bd8cf5f6806b67a72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php

class RoomTab
{
	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);
		}
	}
}