aboutsummaryrefslogtreecommitdiff
path: root/model/Overview.php
blob: 005233fb84d7753eaddd57f2807a10145c8205ad (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
<?php

require_once('model/Room.php');

class Overview
{
	public function getGroups() {
		$groups = array();

		foreach(get('OVERVIEW.GROUPS') as $group => $rooms)
		{
			foreach($rooms as $room)
			{
				try {
					$groups[$group][] = Room::get($room);
				}
				catch(NotFountException $e)
				{
					// just ignore unknown rooms
					continue;
				}
			}
		}

		return $groups;
	}

	public function getReleasesUrl() {
		return get('OVERVIEW.RELEASES');
	}

	public function getReliveUrl() {
		if(has('OVERVIEW.RELIVE'))
			return get('OVERVIEW.RELIVE');

		elseif(has('OVERVIEW.RELIVE_JSON'))
			return 'relive/';

		else
			return null;
	}



	public function hasRelive() {
		return has('OVERVIEW.RELIVE') || has('OVERVIEW.RELIVE_JSON');
	}

	public function hasReleases() {
		return has('OVERVIEW.RELEASES');
	}
}