Zum Ende der Metadaten springen
Zum Anfang der Metadaten

loxberry_web.php is intended to use with and generate to the plugin webinterface.

Inclusion

require_once "loxberry_web.php";

 loxberry_web.php automatically loads loxberry_system.php, so it is not needed to give both libs.

 It's not required to add a path to the PHP library.

Global variables

VariableUsage
LBWeb::$LBWEBVERSION
Returns the library version of loxberry_web.php
LBWeb::$lbpluginpageReturns the absolute URI (w/o host) to the LoxBerry Plugin overview page. Use this link if you provide any "Back" links to the main menu. This is not a local path but an URI.
LBWeb::$lbsystempageReturns the absolute URI (w/o host) to the LoxBerry Settings overview page. This is not a local path but an URI.

 

Functions

Most functions are in the class LBWeb, therefore they need to be called with LBWeb::function(). Some functions are in the main namespace and therefore don't require the LBWeb prefix. The title of every function in this documentation and the examples shows how to call it. 

Most function names and features are identical to the Perl sibling LoxBerry::Web with PHP adjusted syntax. The PHP module also introduces a LoxBerry-own, minimalistic template feature that is used to parse the Perl HTML::Template templates for header and footer (and it is awesome fast against it's Perl brother!). You won't see much of this feature, but it can be used also for own templates.

 

See the examples to start using loxberry_web.php

 PHP functions to create your webpage with LoxBerry design

 

LBWeb::logfile_button_html

Returns HTML code for a logfile button. This function accepts parameters from LBLog / LoxBerry::Log to open the lastest logfile, and also directly a logfile name.

LBWeb::loglevel_select_html

Returns ready HTML code for the plugin loglevel dropdown list. The loglevel setting of the html is saved in the LoxBerry plugin database, therefore this is the same selection as in the plugin management and Log Manager.

LBWeb::loglist_button_html

Returns HTML code for a button to a list of logfiles. This function accepts parameters from LBLog / LoxBerry::Log to show all logfiles of your plugin, and also can filter to a log group name with the NAME parameter.

LBWeb::loglist_html

Returns HTML of the logfile list to directly show the overview of your logfiles in your plugin. It is thought to show the list on navigating a Logfiles tab ($navbar), but you can integrate the HTML where you like.

LBWeb::loglist_url

Returns the URL to a webpage showing a list of your plugins logfiles. This function accepts parameters from LBLog / LoxBerry::Log to show all logfiles of your plugin, and also can filter to a log group name with the NAME parameter.

LBWeb::mslist_select_html

Returns ready HTML code for a Miniserver dropdown list. You can pre-select the current configured Miniserver from a config file.

Navigation Bar (PHP)

Using the PHP functions LBWeb::header or LBWeb::pagestart, it is possible to add a customized navigation bar to your plugin. The navigration bar can be used for internal and external links, and also can show notification bullets. With the navigation bar it is very easy to split up settings to multiple pages.

 

  • Keine Stichwörter