diff options
author | VOC | 2015-11-13 19:48:45 +0100 |
---|---|---|
committer | VOC | 2015-11-13 19:48:45 +0100 |
commit | 92f4fa13749566f6c4378f2c9e80774e8320b825 (patch) | |
tree | f17c6da85da6edba9c7be10138687518ee534d50 /model | |
parent | 32fd126b3fa937389efd1457e9d05daff9f3b347 (diff) | |
parent | 29af764323dc474c14e05985eeabd3a06ef19c86 (diff) |
Merge branch 'mandators'
Diffstat (limited to 'model')
-rw-r--r-- | model/Conferences.php | 77 | ||||
-rw-r--r-- | model/GenericConference.php | 67 | ||||
-rw-r--r-- | model/Room.php | 2 |
3 files changed, 145 insertions, 1 deletions
diff --git a/model/Conferences.php b/model/Conferences.php new file mode 100644 index 0000000..9396a48 --- /dev/null +++ b/model/Conferences.php @@ -0,0 +1,77 @@ +<?php + +class Conferences extends ModelBase +{ + const MANDATOR_DIR = 'configs/conferences/'; + + public static function getConferences() { + $conferences = []; + foreach(scandir(forceslash(Conferences::MANDATOR_DIR)) as $el) + { + if($el[0] == '.') + continue; + + $conferences[$el] = Conferences::getConferenceInformation($el); + } + + return $conferences; + } + public static function getConferencesCount() { + return count(Conferences::getConferences()); + } + + public static function getActiveConferences() { + return array_values(array_filter( + Conferences::getConferences(), + function($info) { + return $info['active']; + } + )); + } + + public static function getActiveConferencesCount() { + return count(Conferences::getActiveConferences()); + } + + public static function exists($mandator) { + return array_key_exists($mandator, Conferences::getConferences()); + } + + public static function getConferenceInformation($mandator) { + if(isset($GLOBALS['CONFIG'])) + $saved_config = $GLOBALS['CONFIG']; + + Conferences::load($mandator); + $conf = new Conference(); + $info = [ + 'slug' => $mandator, + 'link' => forceslash($mandator), + 'active' => !$conf->isClosed(), + 'title' => $conf->getTitle(), + 'description' => $conf->getDescription(), + + 'CONFIG' => $GLOBALS['CONFIG'], + ]; + unset($GLOBALS['CONFIG']); + + if(isset($saved_config)) + $GLOBALS['CONFIG'] = $saved_config; + + return $info; + } + + public static function hasCustomStyles($mandator) { + return file_exists(Conferences::getCustomStyles($mandator)); + } + public static function getCustomStyles($mandator) { + return forceslash(Conferences::getCustomStylesDir($mandator)).'main.less'; + } + public static function getCustomStylesDir($mandator) { + return forceslash(Conferences::MANDATOR_DIR).forceslash($mandator); + } + + public static function load($mandator) { + include(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php'); + return isset($GLOBALS['CONFIG']); + } +} diff --git a/model/GenericConference.php b/model/GenericConference.php new file mode 100644 index 0000000..949766f --- /dev/null +++ b/model/GenericConference.php @@ -0,0 +1,67 @@ +<?php + +class GenericConference extends Conference +{ + public function getTitle() { + return 'C3Voc Streaming'; + } + + public function hasBegun() { + return true; + } + + public function hasEnded() { + return true; + } + + public function hasAuthor() { + return true; + } + public function getAuthor() { + return 'C3Voc'; + } + + public function hasDescription() { + return true; + } + public function getDescription() { + return 'Video Live-Streaming of the CCC'; + } + + public function hasKeywords() { + return true; + } + public function getKeywords() { + return 'Video, Media, Streaming, VOC, C3Voc, CCC'; + } + + + + public function hasReleases() { + return true; + } + public function getReleasesUrl() { + return '//media.ccc.de/'; + } + + public function hasRelive() { + return false; + } + public function getReliveUrl() { + return null; + } + + public function hasBannerHtml() { + return false; + } + public function getBannerHtml() { + return null; + } + + public function hasFooterHtml() { + return false; + } + public function getFooterHtml() { + return null; + } +} diff --git a/model/Room.php b/model/Room.php index 6e37043..124d057 100644 --- a/model/Room.php +++ b/model/Room.php @@ -43,7 +43,7 @@ class Room extends ModelBase } public function getThumb() { - return 'thumbs/'.$this->getStream().'.png'; + return '../thumbs/'.$this->getStream().'.png'; } public function getLink() { |