LoxBerry::Log::get_notifications_html

$html = LoxBerry::Log::get_notifications_html([$package], [$name], [$type]);

Returns HTML code that shows all notifications of the specific package, and/or name and type. The HTML includes buttons to delete the notifications.This function is not exported. Use LoxBerry::Log::get_notifications_html to call it.

The $package is the owner of the notification. This ususally is $lbpplugindir for plugin notifications. Check also the case-sensitivity when setting and querying the notifications.

Inside the package, you can filter your notifications by $name. For example, your plugin uses a cronjob and a daemon. To show only "cronjob" notifications, filter $name by "cronjob".

This is an example of an info notification. The button on the right deletes the notification. Errors have a red error !-symbol in front of the message, informational notifications a blue i-Symbol.

Parameter

ParameterRequiredBeschreibung
$package This is, where the message belongs to. In a plugin, always use the variable $lbpplugindir.
$name The notification group, this notification belongs to. If you omit this parameter, all notifications of all groups are returned.
$type undef = all

'all' = all

'error' = errors only

'info' = info only
Case sensitivity

The content of package and name is case-sensitive. If you set the NAME => "Daemon", you have to query "Daemon" in get_notifications and get_notifications_html.

Usage

use LoxBerry::Log;
 
LoxBerry::Web::lbheader($template_title, $helplink, $helptemplate);
 
# Print your plugins notifications with name daemon.
print LoxBerry::Log::get_notifications_html($lbpplugindir, 'daemon');
 
print $maintemplate->output();
LoxBerry::Web::lbfooter();