System Notifications
Introduced in concrete 5.4, system notifications provided a single location for all external messages to a concrete5 install. These are viewable on the front page of the dashboard and in the Notifications tab of the Dashboard > System page. This is typically used for items like the following:
Notifications of concrete5 updates
- New Help Articles Available
- New Update Articles Available
- Notification of Addon Updates
Addon developers can use this functionality as well, but it should not be abused.
Loading the System Notification Library
Loader::model('system_notification');
Methods
$notification = SystemNotification::add($typeID, $title, $description, $body, $url, $url2 = false)
Adds a new system notification and returns the associated SystemNotification object.
Additional Arguments
- $typeID - one of the following type ID constants (see below).
- $title - the title of the notification.
- $description - a short piece of text to be displayed after the notification title.
- $body - additional long text that will be displayed in a popup window if the notification is clicked on.
- $url, $url2 - Additional URLs which are used based on the type of notification entered.
$notification = SystemNotification::addFromFeed(SimplePie_Item $post, $typeID)
Adds a new system notification based on an RSS Item found in a SimplePie feed. Returns the associated SystemNotification object.
$notification->markSystemNotificationAsRead();
Marks a notification as viewed. Typically happens automatically.
$notification = SystemNotification::getByID($notificationID)
Loads a SystemNotification object and returns it.
The following getters are available for the SystemNotification object.
getSystemNotificationURL()
getSystemNotificationAlternateURL(
getSystemNotificationTitle()
getSystemNotificationDescription()
getSystemNotificationBody()
getSystemNotificationDateTime()
isSystemNotificationNew()
isSystemNotificationArchived()
getSystemNotificationTypeID()
getSystemNotificationID()
Notification Types
The following notification types are available
SystemNotification::SN_TYPE_ADDON_UPDATE SystemNotification::SN_TYPE_ADDON_UPDATE_CRITICAL SystemNotification::SN_TYPE_ADDON_MESSAGE