From efe1f83a7cc419df700dfe36ef11da20607d8eae Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 8 Nov 2015 14:40:30 +0100 Subject: implement mandator handling, supporting different styles per mandantor --- model/Conferences.php | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 model/Conferences.php (limited to 'model') diff --git a/model/Conferences.php b/model/Conferences.php new file mode 100644 index 0000000..05d3c52 --- /dev/null +++ b/model/Conferences.php @@ -0,0 +1,59 @@ +isClosed(); + unset($GLOBALS['CONFIG']); + + if(isset($saved_config)) + $GLOBALS['CONFIG'] = $saved_config; + + return $active; + } + + 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) { + $GLOBALS['MANDATOR'] = $mandator; + include(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php'); + } +} -- cgit v1.2.3 From a0b2129479ba10561811847c0651df8b55c8a6ba Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 8 Nov 2015 15:15:53 +0100 Subject: Support an All-Conference-Closed Screen and mutliple Schedules & Relive-URLs --- model/Conferences.php | 2 +- model/GenericConference.php | 67 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 model/GenericConference.php (limited to 'model') diff --git a/model/Conferences.php b/model/Conferences.php index 05d3c52..9f87388 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -54,6 +54,6 @@ class Conferences extends ModelBase public static function load($mandator) { $GLOBALS['MANDATOR'] = $mandator; - include(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php'); + require(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php'); } } 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 @@ +isClosed(); + $info = [ + 'slug' => $mandator, + 'link' => forceslash($mandator), + 'active' => !$conf->isClosed(), + 'title' => $conf->getTitle(), + 'description' => $conf->getDescription(), + ]; unset($GLOBALS['CONFIG']); if(isset($saved_config)) $GLOBALS['CONFIG'] = $saved_config; - return $active; + return $info; } public static function hasCustomStyles($mandator) { -- cgit v1.2.3 From aec65f8a241d3810d5e7a029f861bc6090b65cb9 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 8 Nov 2015 17:17:16 +0100 Subject: better exception-handling in mandator-code --- model/Conferences.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'model') diff --git a/model/Conferences.php b/model/Conferences.php index 10a3172..885c2c8 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -69,7 +69,7 @@ class Conferences extends ModelBase } public static function load($mandator) { - $GLOBALS['MANDATOR'] = $mandator; - require(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php'); + include(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php'); + return isset($GLOBALS['CONFIG']); } } -- cgit v1.2.3 From 61c9cf52b0c015951351b47148cdecb47c680bfa Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 8 Nov 2015 20:36:34 +0100 Subject: global streams api --- model/Conferences.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'model') diff --git a/model/Conferences.php b/model/Conferences.php index 885c2c8..9396a48 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -49,6 +49,8 @@ class Conferences extends ModelBase 'active' => !$conf->isClosed(), 'title' => $conf->getTitle(), 'description' => $conf->getDescription(), + + 'CONFIG' => $GLOBALS['CONFIG'], ]; unset($GLOBALS['CONFIG']); -- cgit v1.2.3 From afc1a5caf3feaabf2768560705bdb92a2607a19c Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 8 Nov 2015 20:36:45 +0100 Subject: fix thumbs url --- model/Room.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'model') 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() { -- cgit v1.2.3