LoxBerry::Web::loglist_button_html

LoxBerry::Web::logfile_button_html( %params );

 

Returns HTML code for a button to a webpage with all logfiles of your plugin. This function lists all logfiles of your plugin, and additionally accepts the NAME parameter from LoxBerry::Log to filter to a specific log group name.

LoxBerry Compatibility

This function is available starting with LoxBerry V1.2.1. If you use that function, set this minimum version in your plugin.cfg.

This feature only works with logfiles creates with the module LoxBerry::Log (Perl) or LBLog (PHP). It does not work for logfiles created without these LoxBerry SDK modules.

The function returns a string with HTML code to show a button to link to an own webpage, listing all logfiles of your plugin. Additionally, with the NAME parameter, you can filter to a specific logfile group name (e.g. 'Daemon') to only show that logfiles.

To give parameters to the function, use named parameters.

Parameter

Case sensitivity

All parameter names are case-sensitive and written in capital letters.

ParameterOptionalUsage
NAME x NAME is the log group name used with LoxBerry::Log. If you have created a logfile with LoxBerry::Log::new( name ⇒ 'daemon'), use NAME ⇒ 'daemon' to list only logfiles of that group.

If you omit the NAME parameter, the list includes all logfiles of your plugin, independent of the log group name.
PACKAGE x Package is not required in the case of a plugin. By default, this is (like with LoxBerry::Log) the $lbpplugindir-Variable.

Core-Developers have to use the PACKAGE parameter.
LABEL x By default, LoxBerry labels the button with the language-specific "Show all logfiles" phrase.

To change the default label, use the LABEL parameter.
DATA_MINIx By default, the function uses the jQuery Mobile tag data-mini="true". To have the full-sized button, send DATA_MINI ⇒ "0".
DATA_ICONx By default, the function uses the list icon from jQuery Mobile, "bars" (data-icon="bars"). To change the icon, send the icon name here.

Return value

Returns a string that is the HTML code for the Logfile button. Simply print the result of the function to your webpage.

Returns undef, if the call failed.

Usage

use LoxBerry::Web;
 
# Show a button to the list of all logfiles of name 'daemon', created by LoxBerry::Log
print LoxBerry::Web::logfile_button_html ( NAME => 'daemon' );
 
# Modify the label and the icon of the button:
print LoxBerry::Web::logfile_button_html ( NAME => 'daemon', LABEL => 'Open my logfile', DATA_ICON => 'arrow-r' );
 
 
# Button to a list of all plugins logfiles
print LoxBerry::Web::logfile_button_html();
 
 
# Core-developers: Also use the PACKAGE parameter
print LoxBerry::Web::logfile_button_html( PACKAGE => 'Plugins Update', NAME => 'check' );