diff options
-rw-r--r-- | assets/css/_structure.less | 22 | ||||
-rw-r--r-- | model/Conference.php | 12 | ||||
-rw-r--r-- | template/assemblies/header.phtml | 7 | ||||
-rw-r--r-- | template/page.phtml | 6 |
4 files changed, 41 insertions, 6 deletions
diff --git a/assets/css/_structure.less b/assets/css/_structure.less index 422bfab..13cd86a 100644 --- a/assets/css/_structure.less +++ b/assets/css/_structure.less @@ -61,6 +61,28 @@ nav { } } +.preview-warning { + position: fixed; + top: 0; + right: 0; + background: red; + width: 190px; + height: 100px; + z-index: 2000; + text-align: center; + border-bottom-left-radius: 60px; + line-height: 40px; + padding-left: 10px; + font-size: 30px; + padding-top: 9px; + color: white; + cursor: default; + + &:hover { + opacity: 0.1; + } +} + body { padding: 50px 0; diff --git a/model/Conference.php b/model/Conference.php index 701d7c7..8a8291b 100644 --- a/model/Conference.php +++ b/model/Conference.php @@ -6,16 +6,18 @@ class Conference extends ModelBase return $this->get('CONFERENCE.TITLE', 'C3Voc Streaming'); } + public function isPreviewEnabled() { + return $this->has('PREVIEW_DOMAIN') && ($this->get('PREVIEW_DOMAIN') == $_SERVER['HTTP_HOST']); + } + public function isClosed() { return !$this->hasBegun() || $this->hasEnded(); } public function hasBegun() { // on the preview-domain all conferences are always open - if($this->has('PREVIEW_DOMAIN') && $this->get('PREVIEW_DOMAIN') == $_SERVER['HTTP_HOST']) - { + if($this->isPreviewEnabled()) return true; - } if($this->has('CONFERENCE.CLOSED')) { $closed = $this->get('CONFERENCE.CLOSED'); @@ -42,10 +44,8 @@ class Conference extends ModelBase public function hasEnded() { // on the preview-domain no conference ever ends - if($this->has('PREVIEW_DOMAIN') && $this->get('PREVIEW_DOMAIN') == $_SERVER['HTTP_HOST']) - { + if($this->isPreviewEnabled()) return false; - } if($this->has('CONFERENCE.CLOSED')) { $closed = $this->get('CONFERENCE.CLOSED'); diff --git a/template/assemblies/header.phtml b/template/assemblies/header.phtml index 955d074..57beb5f 100644 --- a/template/assemblies/header.phtml +++ b/template/assemblies/header.phtml @@ -31,3 +31,10 @@ </div> </div> </nav> + + +<? if($conference->isPreviewEnabled()): ?> +<div class="preview-warning"> + PREVIEW MODE +</div> +<? endif ?>
\ No newline at end of file diff --git a/template/page.phtml b/template/page.phtml index a358a27..73a12ad 100644 --- a/template/page.phtml +++ b/template/page.phtml @@ -1,5 +1,11 @@ <!DOCTYPE html> +<? if($conference->isPreviewEnabled()): ?> +<!-- + RUNNING IN PREVIEW MODE + OPEN/CLOSED INFORMATION IS IGNORED! +--> +<? endif ?> <html> <head> |