aboutsummaryrefslogtreecommitdiff
path: root/model/Overview.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--model/Overview.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/model/Overview.php b/model/Overview.php
new file mode 100644
index 0000000..005233f
--- /dev/null
+++ b/model/Overview.php
@@ -0,0 +1,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');
+ }
+}