aboutsummaryrefslogtreecommitdiff
path: root/model/Conference.php
diff options
context:
space:
mode:
authorMaZderMind2016-12-18 10:37:58 +0100
committerMaZderMind2016-12-18 10:37:58 +0100
commit23c70f3042251675796ebff7f3568005a335fa73 (patch)
tree547688e0ef964adb2eb28e1419e62f796f28ddd6 /model/Conference.php
parent738878b8b060b3cfcdde2d88a1a28d5ce83e4aa7 (diff)
parentda739f3b60a30d5dd5c7877742f8b5c292f25f46 (diff)
Merge branch 'feature/20-declarative-downloading'
fixes #20
Diffstat (limited to '')
-rw-r--r--model/Conference.php30
1 files changed, 23 insertions, 7 deletions
diff --git a/model/Conference.php b/model/Conference.php
index 07d72dd..8d387a0 100644
--- a/model/Conference.php
+++ b/model/Conference.php
@@ -19,7 +19,7 @@ class Conference extends ModelBase
}
public function isPreviewEnabled() {
- if($GLOBALS['forceopen'])
+ if(@$GLOBALS['forceopen'])
return true;
if($this->has('PREVIEW_DOMAIN') && ($this->get('PREVIEW_DOMAIN') == $_SERVER['SERVER_NAME']))
@@ -32,12 +32,22 @@ class Conference extends ModelBase
return !$this->hasBegun() || $this->hasEnded();
}
+ public function isOpen() {
+ return !$this->isClosed();
+ }
+
public function startsAt() {
- return $this->get('CONFERENCE.STARTS_AT');
+ if(!$this->has('CONFERENCE.STARTS_AT'))
+ return null;
+
+ return DateTime::createFromFormat('U', $this->get('CONFERENCE.STARTS_AT'));
}
public function endsAt() {
- return $this->get('CONFERENCE.ENDS_AT');
+ if(!$this->has('CONFERENCE.ENDS_AT'))
+ return null;
+
+ return DateTime::createFromFormat('U', $this->get('CONFERENCE.ENDS_AT'));
}
public function hasBegun() {
@@ -62,7 +72,8 @@ class Conference extends ModelBase
}
if($this->has('CONFERENCE.STARTS_AT')) {
- return time() >= $this->get('CONFERENCE.STARTS_AT');
+ $now = new DateTime('now');
+ return $now >= $this->startsAt();
} else {
return true;
}
@@ -84,7 +95,8 @@ class Conference extends ModelBase
}
if($this->has('CONFERENCE.ENDS_AT')) {
- return time() >= $this->get('CONFERENCE.ENDS_AT');
+ $now = new DateTime('now');
+ return $now >= $this->endsAt();
} else {
return false;
}
@@ -128,10 +140,10 @@ class Conference extends ModelBase
}
public function hasRelive() {
- return $this->has('CONFERENCE.RELIVE_JSON');
+ return $this->getRelive()->isEnabled();
}
public function getReliveUrl() {
- if($this->has('CONFERENCE.RELIVE_JSON'))
+ if($this->getRelive()->isEnabled())
return joinpath([$this->getSlug(), 'relive']).url_params();
else
@@ -209,4 +221,8 @@ class Conference extends ModelBase
public function getRelive() {
return new Relive($this);
}
+
+ public function getExtraFiles() {
+ return $this->get('EXTRA_FILES', []);
+ }
}