From 90fa5e229c8e25b0371cfd916f3463f9ea50d881 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Wed, 30 Dec 2015 23:08:19 +0100 Subject: show last conference & relive on startpage --- model/Conferences.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'model') 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']); -- cgit v1.2.3