2015-03-15 18:13:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Conference extends ModelBase
|
|
|
|
{
|
|
|
|
public function getTitle() {
|
2015-12-25 20:32:53 +00:00
|
|
|
return $this->get('CONFERENCE.TITLE', 'C3VOC Streaming');
|
2015-03-15 18:13:25 +00:00
|
|
|
}
|
|
|
|
|
2015-12-23 12:53:05 +00:00
|
|
|
public function isPreviewEnabled() {
|
2015-12-23 13:12:10 +00:00
|
|
|
return $this->has('PREVIEW_DOMAIN') && ($this->get('PREVIEW_DOMAIN') == $_SERVER['SERVER_NAME']);
|
2015-12-23 12:53:05 +00:00
|
|
|
}
|
|
|
|
|
2015-04-04 18:11:25 +00:00
|
|
|
public function isClosed() {
|
2015-09-02 10:56:32 +00:00
|
|
|
return !$this->hasBegun() || $this->hasEnded();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasBegun() {
|
2015-12-23 10:58:44 +00:00
|
|
|
// on the preview-domain all conferences are always open
|
2015-12-23 12:53:05 +00:00
|
|
|
if($this->isPreviewEnabled())
|
2015-12-23 10:58:44 +00:00
|
|
|
return true;
|
|
|
|
|
2015-09-02 10:56:32 +00:00
|
|
|
if($this->has('CONFERENCE.CLOSED')) {
|
|
|
|
$closed = $this->get('CONFERENCE.CLOSED');
|
|
|
|
|
|
|
|
/* when CLOSED is a boolean, we're reading an old config where
|
|
|
|
* conferences didn't have a pre-beginning phase, thus we always
|
|
|
|
* return true.
|
|
|
|
*/
|
|
|
|
if(gettype($closed) == "boolean")
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if($closed == "before")
|
|
|
|
return false;
|
2015-09-02 14:54:42 +00:00
|
|
|
else if($closed == "running" || $closed == "after")
|
2015-09-02 10:56:32 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-09-09 01:40:40 +00:00
|
|
|
if($this->has('CONFERENCE.STARTS_AT')) {
|
|
|
|
return time() >= $this->get('CONFERENCE.STARTS_AT');
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
2015-09-02 10:56:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function hasEnded() {
|
2015-12-23 10:58:44 +00:00
|
|
|
// on the preview-domain no conference ever ends
|
2015-12-23 12:53:05 +00:00
|
|
|
if($this->isPreviewEnabled())
|
2015-12-23 10:58:44 +00:00
|
|
|
return false;
|
|
|
|
|
2015-09-02 10:56:32 +00:00
|
|
|
if($this->has('CONFERENCE.CLOSED')) {
|
|
|
|
$closed = $this->get('CONFERENCE.CLOSED');
|
|
|
|
|
|
|
|
if($closed == "after" || $closed === true)
|
|
|
|
return true;
|
2015-09-02 14:54:42 +00:00
|
|
|
else if($closed == "running" || $closed == "before" ||
|
|
|
|
$closed === false)
|
2015-09-02 10:56:32 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-09-09 01:40:40 +00:00
|
|
|
if($this->has('CONFERENCE.ENDS_AT')) {
|
|
|
|
return time() >= $this->get('CONFERENCE.ENDS_AT');
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2015-04-04 18:11:25 +00:00
|
|
|
}
|
|
|
|
|
2015-03-15 18:13:25 +00:00
|
|
|
public function hasAuthor() {
|
|
|
|
return $this->has('CONFERENCE.AUTHOR');
|
|
|
|
}
|
|
|
|
public function getAuthor() {
|
|
|
|
return $this->get('CONFERENCE.AUTHOR', '');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasDescription() {
|
|
|
|
return $this->has('CONFERENCE.DESCRIPTION');
|
|
|
|
}
|
|
|
|
public function getDescription() {
|
|
|
|
return $this->get('CONFERENCE.DESCRIPTION', '');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasKeywords() {
|
|
|
|
return $this->has('CONFERENCE.KEYWORDS');
|
|
|
|
}
|
|
|
|
public function getKeywords() {
|
|
|
|
return $this->get('CONFERENCE.KEYWORDS', '');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function hasReleases() {
|
|
|
|
return $this->has('CONFERENCE.RELEASES');
|
|
|
|
}
|
|
|
|
public function getReleasesUrl() {
|
|
|
|
return $this->get('CONFERENCE.RELEASES');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasRelive() {
|
2015-08-29 13:31:56 +00:00
|
|
|
return $this->has('CONFERENCE.RELIVE_JSON');
|
2015-03-15 18:13:25 +00:00
|
|
|
}
|
|
|
|
public function getReliveUrl() {
|
2015-08-29 13:31:56 +00:00
|
|
|
if($this->has('CONFERENCE.RELIVE_JSON'))
|
2015-03-15 18:13:25 +00:00
|
|
|
return 'relive/';
|
|
|
|
|
|
|
|
else
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasBannerHtml() {
|
|
|
|
return $this->has('CONFERENCE.BANNER_HTML');
|
|
|
|
}
|
|
|
|
public function getBannerHtml() {
|
|
|
|
return $this->get('CONFERENCE.BANNER_HTML');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasFooterHtml() {
|
|
|
|
return $this->has('CONFERENCE.FOOTER_HTML');
|
|
|
|
}
|
|
|
|
public function getFooterHtml() {
|
|
|
|
return $this->get('CONFERENCE.FOOTER_HTML');
|
|
|
|
}
|
|
|
|
}
|