Script Extensions

Estimated reading: 3 minutes

LIMBAS allows inclusion of extensions for special applications. There are two options:

Extend LIMBAS core with your own script

When LIMBAS is started, it identifies all files “ext_*.inc” from the directory ./dependent/EXTENSIONS and any subdirectories. Prior to the execution of a script .php, .dao or .lib it is verified if one or more (from various subdirectories) ext_.inc are present. If so they will be executed if necessary.
In the current version the following Source Files can be extended:

Source ScriptExtension NameExecutionFunctionality
session_auth.libext_global.incSkript startGlobal
main.phpext_main.incSkriptmitteHome Page
main.phpext_main.jsSkriptendeHome Page Javascript Body elements
main_admin.phpext_main_admin.incScript middleAdmin Home Page
main_dyns.phpext_ajax.incSkript startHome Page for Ajax-Calls
gtab/gtab.libext_gtab.incSkriptanfangBasic functions for all database queries and changes
gtab/html/gtab_erg.phpext_gtab_erg.incScript startFunctions for the list view
gtab/html/gtab_erg.daoext_gtab_erg_dao.incScript startFunctions for the list view
gtab/dao/gtab_change.daoext_gtab_change.incScript startFunctions for the detail view
lib/session_auth.libext_session_auth.incScript endFunctions for the Session Initialization
lib/session_auth.libext_ldap.incScript startFunctions for LDAP authentication
extra/report/report.daoext_report.incSkriptanfangFunktionen für Reports
extra/explorer/filestructure.libext_explorer.incScript startFunctions for LIMBAS DMS
layout/nav.phpext_nav.incScript endExtension of the navigation bar
extra/multiframe/multiframe.daoext_multiframe.incScript endFunctions for displays in the multi-purpose window on the right edge of the browser
layout/style/css.phpext_css.incScript endExtension for overrides of the main stylesheet of Limbas (for direct layout adjustments)
main.phpext_main.cssScript middleAdditionally integrated CSS for own extensions

Generally, unlimited extension scripts can be created, using the same name but saved in different folders. You can create your own folder structure in the ./dependent/EXTENSIONS directory which will give you a better overview.

Expand LIMBAS with own functions

The script to be executed by LIMBAS, must be in the directory ./dependent/EXTENSIONS or a subdirectory in a file with the extension *.ext

In Admin->Setup->Menu Items the script has to be selected, for the menu item that triggers the execution of the script. If the menu item already has a Limbas action the originally planned action will not be executed. Additionally own menu items can be added. These can be authorized and used to the full extend in extensions. Actions or links that are not used in menus can also be used like “menu items”.

In the example the file helloworld.ext is executed. It includes the following example code:

The action can now be call by the following link: http://…openlimbas/dependent/main.php?action=nav_meinMenue.

Extend the main.php with the file ext_main.inc

This file must be created in the directory /dependent/EXTENSIONS or a subdirectory. In order to select an extension for a new main menue item first an action must be inserted.
The action can be any name which will later be used to call the extension. (attention: each name can only be used once)
The call is carried out by the additon of the limbas link by “main.php?action=NAME_OF_THE_ACTION”.

The line “$action=’null'” is an important entry, because otherwise all following actions will be executed.

If you call now the link …/main.php?action=nav_myMenue in the browser you can see the return value “hello”.