diff options
author | MaZderMind | 2015-04-04 20:11:25 +0200 |
---|---|---|
committer | MaZderMind | 2015-04-04 20:12:49 +0200 |
commit | 0fb8904157ea87997fa662ad2c975d773dd75455 (patch) | |
tree | 9d3f1c505fd499f637bc4926a7feb19fffce4c5e | |
parent | 69c2ec30e6131a2ad205a4a1b77abcbed40c7670 (diff) |
Implement Close-Down Page with Upcoming Event
-rw-r--r-- | assets/css/_bootstrap-selection.less | 2 | ||||
-rw-r--r-- | config.php | 7 | ||||
-rw-r--r-- | index.php | 33 | ||||
-rw-r--r-- | model/Conference.php | 4 | ||||
-rw-r--r-- | model/Upcoming.php | 19 | ||||
-rw-r--r-- | template/closed.phtml | 25 | ||||
-rw-r--r-- | view/closed.php | 10 |
7 files changed, 87 insertions, 13 deletions
diff --git a/assets/css/_bootstrap-selection.less b/assets/css/_bootstrap-selection.less index dcddb2e..8d532ca 100644 --- a/assets/css/_bootstrap-selection.less +++ b/assets/css/_bootstrap-selection.less @@ -33,7 +33,7 @@ @import "bootstrap-3.3.2/alerts.less"; //@import "bootstrap-3.3.2/progress-bars.less"; //@import "bootstrap-3.3.2/media.less"; -//@import "bootstrap-3.3.2/list-group.less"; +@import "bootstrap-3.3.2/list-group.less"; @import "bootstrap-3.3.2/panels.less"; //@import "bootstrap-3.3.2/responsive-embed.less"; @import "bootstrap-3.3.2/wells.less"; @@ -11,6 +11,13 @@ if($_SERVER['HTTP_HOST'] != 'localhost') $GLOBALS['CONFIG']['CONFERENCE'] = array( /** + * Am Ende der Konferenz wird durch das Umlegen dieses Schalters auf True eine Danke-Und-Kommen-Sie- + * Gut-Nach-Hause-Seite sowie einem Ausblick auf die kommenden Events angezeigt. Während einer + * Konferenz kann dieser Schalter auskommentiert oder auf false gesetzt werden. + */ + 'CLOSED' => false, + + /** * Titel der Konferenz (kann Leer- und Sonderzeichen enthalten) * Dieser im Seiten-Header, im <title>-Tag, in der About-Seite und ggf. ab weiteren Stellen als * Anzeigetext benutzt @@ -16,10 +16,12 @@ require_once('model/RoomTab.php'); require_once('model/RoomSelection.php'); require_once('model/Stream.php'); require_once('model/Relive.php'); +require_once('model/Upcoming.php'); $route = @$_GET['route']; $route = rtrim($route, '/'); +$conference = new Conference(); $tpl = new PhpTemplate('template/page.phtml'); $tpl->set(array( @@ -27,7 +29,7 @@ $tpl->set(array( 'route' => $route, 'assemblies' => './template/assemblies/', - 'conference' => new Conference(), + 'conference' => $conference, 'feedback' => new Feedback(), 'schedule' => new Schedule(), )); @@ -35,36 +37,43 @@ $tpl->set(array( ob_start(); try { - if($route == '') + + + if($route == 'feedback/read') + { + require('view/feedback-read.php'); + } + + else if($conference->isClosed()) + { + require('view/closed.php'); + } + + else if($route == '') { require('view/overview.php'); } - else if(preg_match('@^about$@', $route, $m)) + else if($route == 'about') { require('view/about.php'); } - else if(preg_match('@^schedule.json$@', $route, $m)) + else if($route == 'schedule.json') { require('view/schedule-json.php'); } - else if(preg_match('@^multiview$@', $route, $m)) + else if($route == 'multiview') { require('view/multiview.php'); } - else if(preg_match('@^feedback$@', $route, $m)) + else if($route == 'feedback') { require('view/feedback.php'); } - else if(preg_match('@^feedback/read$@', $route, $m)) - { - require('view/feedback-read.php'); - } - else if(preg_match('@^relive/([0-9]+)$@', $route, $m)) { $_GET = array( @@ -73,7 +82,7 @@ try { require('view/relive-player.php'); } - else if(preg_match('@^relive$@', $route, $m)) + else if($route == 'relive') { require('view/relive.php'); } diff --git a/model/Conference.php b/model/Conference.php index e9e33a6..a4c14aa 100644 --- a/model/Conference.php +++ b/model/Conference.php @@ -6,6 +6,10 @@ class Conference extends ModelBase return $this->get('CONFERENCE.TITLE', 'C3Voc Streaming'); } + public function isClosed() { + return $this->get('CONFERENCE.CLOSED'); + } + public function hasAuthor() { return $this->has('CONFERENCE.AUTHOR'); } diff --git a/model/Upcoming.php b/model/Upcoming.php new file mode 100644 index 0000000..6f54814 --- /dev/null +++ b/model/Upcoming.php @@ -0,0 +1,19 @@ +<?php + +class Upcoming +{ + public function getNextEvent() + { + try { + $events = file_get_contents('https://c3voc.de/eventkalender/events.json?filter=upcoming'); + $events = json_decode($events, true); + $names = array_keys($events['voc_events']); + + return $events['voc_events'][$names[0]]; + } + catch(ErrorException $e) + { + return null; + } + } +} diff --git a/template/closed.phtml b/template/closed.phtml new file mode 100644 index 0000000..f6734fa --- /dev/null +++ b/template/closed.phtml @@ -0,0 +1,25 @@ +<div class="container about"> + <h1><?=h($conference->getTitle())?> is over!</h1> + + <? if($upcoming): ?> + <h2>See you soon at <?=h($upcoming['name'])?></h2> + <? endif ?> + + <p> + Lecture recording and streaming at <strong><?=h($conference->getTitle())?></strong> was organized and performed by the <a href="http://c3voc.de">Chaos Computer Club Video Operation Center</a>. The next Event we'll attend will be at + </p> + + <br><br><br> + + <div class="col-xs-10 col-xs-offset-1 col-md-6 col-md-offset-3"> + + <div class="panel panel-default"> + <div class="panel-heading"><?=h($upcoming['name'])?></div> + <div class="panel-body"> + <?=h($upcoming['location'])?><br /> + <?=h($upcoming['start_date'])?> – <?=h($upcoming['end_date'])?> + </div> + </div> + + </div> +</div> diff --git a/view/closed.php b/view/closed.php new file mode 100644 index 0000000..e1b126c --- /dev/null +++ b/view/closed.php @@ -0,0 +1,10 @@ +<?php + +$upcoming = new Upcoming(); + +echo $tpl->render(array( + 'page' => 'closed', + 'title' => 'See you soon … somewhere else!', + + 'upcoming' => $upcoming->getNextEvent(), +)); |