notify_ext( $dataarray );
Creates an information or error notification with extended attributes. Use this function, if you want to store more information in your notification than a simple LBLog::notify.
This function is available starting with LoxBerry V1.0.3. If you use that function, set this minimum version in your plugin.cfg.
notify_ext (ext for extended) allows you to store more than one attribute (the message) in a notification.
You can use the notification to transport more detailed information or settings from the sending side (the script calling notify_ext) to the receiver (the script or webinterface receiving the notification). Remember that the notification is still displayed as a number in the plugins overview page. The additional information should be read with get_notifications and parsed and displayed in a way that the user still can see the coherence between the notification bullet on the plugins page and the main page of your plugin.
So as in notify, the PACKAGE, NAME and MESSAGE are mandatory parameters. To these parameters, add as many attributes you like. See the example how it works.
The PACKAGE is the owner of the notification. To show the notification bullet on the plugins page, this needs to be
$lbpplugindir or the constant LBPPLUGINDIR.
Inside the package, you can group your notifications by
NAME. For example, your plugin uses a cronjob and a daemon. Use "cronjob" and "daemon" as names to differentiate these notifications.
MESSAGE is the text that is saved and displayed in the notification.
All additional parameters are stored to query them by get_notifications.
notify_ext always saves the time you have called notify, so you don't need to place a timestamp in the message.
The parameter names
SEVERITY are case-sensitive.
The content of
NAME is also case-sensitive. If you set the
NAME => "Daemon", you have to query
Call notify_ext with one parameter, that is an array of all the data.
Not all parameters are required.
|PACKAGE||x||This is, where the message belongs to. In a plugin, always use the variable $lbpplugindir.|
|NAME||x||The notification group, this notification belongs to.|
|MESSAGE||x||The message to be sent.|
If you omit this parameter, an informational notification (severity 6) is created.
If you specify the severity, use a level from 0 to 7 (see the log levels here: plugindatabase.dat)
Use 6 for info or 3 for error. Other levels currently are undefined.
This optional parameter can be used to add a link with a "Details" button.
Setting the LINK parameter and filling it with an internal or external hyperlink, will show a "Details" button in the get_notifications_html page.
This optional parameter can be used to add a local path to a logfile.
get_notification_html will show a logfile button to directly open the logviewer, if the LOGFILE parameter is found.
The function currently returns no state information.
All the parameters are stored and will be returned in an array if you query the notifications.
LOGFILE parameter will add a logfile button in the notification view.
Please see the Notification tips and tricks