diff options
author | MaZderMind | 2015-12-30 23:08:19 +0100 |
---|---|---|
committer | MaZderMind | 2015-12-30 23:08:19 +0100 |
commit | 90fa5e229c8e25b0371cfd916f3463f9ea50d881 (patch) | |
tree | fe97792e31a04825bd8d443e26ea77baac2bb537 /model/Conferences.php | |
parent | 2b934d63f318db93d5acbd9c6782c130a0f42f54 (diff) |
show last conference & relive on startpage
Diffstat (limited to 'model/Conferences.php')
-rw-r--r-- | model/Conferences.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/model/Conferences.php b/model/Conferences.php index 9396a48..ab7fe0e 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -33,6 +33,20 @@ class Conferences extends ModelBase return count(Conferences::getActiveConferences()); } + public static function getConferencesSorted() { + $sorted = Conferences::getConferences(); + + usort($sorted, function($a, $b) { + return @$b['CONFIG']['CONFERENCE']['STARTS_AT'] - @$a['CONFIG']['CONFERENCE']['STARTS_AT']; + }); + + return $sorted; + } + + public static function getLastConference() { + return Conferences::getConferencesSorted()[0]; + } + public static function exists($mandator) { return array_key_exists($mandator, Conferences::getConferences()); } @@ -50,6 +64,9 @@ class Conferences extends ModelBase 'title' => $conf->getTitle(), 'description' => $conf->getDescription(), + 'relive' => forceslash($mandator).$conf->getReliveUrl(), + 'releases' => $conf->getReleasesUrl(), + 'CONFIG' => $GLOBALS['CONFIG'], ]; unset($GLOBALS['CONFIG']); |