aboutsummaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorMaZderMind2015-11-08 16:31:29 +0100
committerMaZderMind2015-11-08 16:31:29 +0100
commit0d91cc5f111fac882f1bb375c2bf426195c9cae2 (patch)
tree255e2f352f204fac8090cc837287167d3714f600 /model
parenta0b2129479ba10561811847c0651df8b55c8a6ba (diff)
finish overview-page
Diffstat (limited to 'model')
-rw-r--r--model/Conferences.php32
1 files changed, 24 insertions, 8 deletions
diff --git a/model/Conferences.php b/model/Conferences.php
index 9f87388..10a3172 100644
--- a/model/Conferences.php
+++ b/model/Conferences.php
@@ -5,9 +5,16 @@ class Conferences extends ModelBase
const MANDATOR_DIR = 'configs/conferences/';
public static function getConferences() {
- return array_values(array_filter(scandir(forceslash(Conferences::MANDATOR_DIR)), function($el) {
- return $el[0] != '.';
- }));
+ $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());
@@ -15,7 +22,10 @@ class Conferences extends ModelBase
public static function getActiveConferences() {
return array_values(array_filter(
- Conferences::getConferences(), ['Conferences', 'isActive']
+ Conferences::getConferences(),
+ function($info) {
+ return $info['active'];
+ }
));
}
@@ -24,22 +34,28 @@ class Conferences extends ModelBase
}
public static function exists($mandator) {
- return in_array($mandator, Conferences::getConferences());
+ return array_key_exists($mandator, Conferences::getConferences());
}
- public static function isActive($mandator) {
+ public static function getConferenceInformation($mandator) {
if(isset($GLOBALS['CONFIG']))
$saved_config = $GLOBALS['CONFIG'];
Conferences::load($mandator);
$conf = new Conference();
- $active = !$conf->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) {