aboutsummaryrefslogtreecommitdiff
path: root/model/Conference.php
diff options
context:
space:
mode:
Diffstat (limited to 'model/Conference.php')
-rw-r--r--model/Conference.php84
1 files changed, 81 insertions, 3 deletions
diff --git a/model/Conference.php b/model/Conference.php
index c6afa98..07d72dd 100644
--- a/model/Conference.php
+++ b/model/Conference.php
@@ -2,6 +2,18 @@
class Conference extends ModelBase
{
+ private $slug;
+
+ public function __construct($config, $slug)
+ {
+ parent::__construct($config);
+ $this->slug = $slug;
+ }
+
+ public function getSlug() {
+ return $this->slug;
+ }
+
public function getTitle() {
return $this->get('CONFERENCE.TITLE', 'C3VOC');
}
@@ -20,6 +32,14 @@ class Conference extends ModelBase
return !$this->hasBegun() || $this->hasEnded();
}
+ public function startsAt() {
+ return $this->get('CONFERENCE.STARTS_AT');
+ }
+
+ public function endsAt() {
+ return $this->get('CONFERENCE.ENDS_AT');
+ }
+
public function hasBegun() {
// on the preview-domain all conferences are always open
if($this->isPreviewEnabled())
@@ -101,10 +121,10 @@ class Conference extends ModelBase
}
public function getLink() {
- return url_params();
+ return forceslash($this->getSlug()).url_params();
}
public function getAboutLink() {
- return 'about/'.url_params();
+ return joinpath([$this->getSlug(), 'about']).url_params();
}
public function hasRelive() {
@@ -112,12 +132,26 @@ class Conference extends ModelBase
}
public function getReliveUrl() {
if($this->has('CONFERENCE.RELIVE_JSON'))
- return 'relive/'.url_params();
+ return joinpath([$this->getSlug(), 'relive']).url_params();
else
return null;
}
+ public function hasFeedback() {
+ return $this->has('FEEDBACK');
+ }
+ public function getFeedbackUrl() {
+ return joinpath([$this->getSlug(), 'feedback']).url_params();
+ }
+ public function getFeedbackReadUrl() {
+ return joinpath([$this->getSlug(), 'feedback', 'read']).url_params();
+ }
+
+ public function getScheduleJsonUrl() {
+ return joinpath([$this->getSlug(), 'schedule.json']).url_params();
+ }
+
public function hasBannerHtml() {
return $this->has('CONFERENCE.BANNER_HTML');
}
@@ -131,4 +165,48 @@ class Conference extends ModelBase
public function getFooterHtml() {
return $this->get('CONFERENCE.FOOTER_HTML');
}
+
+
+ public function getRooms()
+ {
+ $rooms = array();
+ foreach($this->get('ROOMS') as $slug => $room)
+ $rooms[] = $this->getRoom($slug);
+
+ return $rooms;
+ }
+
+ public function getRoomIfExists($room)
+ {
+ if($this->hasRoom($room))
+ return $this->getRoom($room);
+
+ return null;
+ }
+
+ public function hasRoom($slug)
+ {
+ return $this->has('ROOMS.'.$slug);
+ }
+
+ public function getRoom($room) {
+ return new Room($this, $room);
+ }
+
+
+ public function getFeedback() {
+ return new Feedback($this);
+ }
+ public function getSchedule() {
+ return new Schedule($this);
+ }
+ public function getSubtitles() {
+ return new Subtitles($this);
+ }
+ public function getOverview() {
+ return new Overview($this);
+ }
+ public function getRelive() {
+ return new Relive($this);
+ }
}