diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-27 00:02:52 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-27 00:03:08 +0400 |
commit | d99772cc378a02413d26578fcc2ae8388f494482 (patch) | |
tree | 0c659ef37680f5bd2e6d2f6a3fdaaaa8dc2a5fa7 /core/Notification | |
parent | f1387bf5e08a562738953bfa3d01044e7488f2ff (diff) |
refs #4179 sort notifications by priority
Diffstat (limited to 'core/Notification')
-rw-r--r-- | core/Notification/Manager.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/Notification/Manager.php b/core/Notification/Manager.php index ad30e4fd7a..62b245a389 100644 --- a/core/Notification/Manager.php +++ b/core/Notification/Manager.php @@ -39,7 +39,17 @@ class Manager public static function getAllNotificationsToDisplay() { $session = static::getSession(); - return $session->getIterator(); + $notifications = $session->getIterator(); + + $notifications->uasort(function ($n1, $n2) { + if ($n1->priority == $n2->priority) { + return 0; + } + + return $n1->priority > $n2->priority; + }); + + return $notifications; } /** |