Skip to content

Script Extensions

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 Script Extension Name Execution Functionality
session_auth.lib ext_global.inc script begin Global
main.php ext_main.inc script middle Home Page
main.php ext_main.js script end Home Page Javascript Body elements
main_admin.php ext_main_admin.inc script middle Admin Home Page
main_dyns.php ext_ajax.inc script begin Home Page for Ajax-Calls
gtab/gtab.lib ext_gtab.inc script begin Basic functions for all database queries and changes
gtab/html/gtab_erg.php ext_gtab_erg.inc script begin Functions for the list view
gtab/html/gtab_erg.dao ext_gtab_erg_dao.inc script begin Functions for the list view
gtab/dao/gtab_change.dao ext_gtab_change.inc script begin Functions for the detail view
lib/session_auth.lib ext_session_auth.inc script end Functions for the Session Initialization
lib/session_auth.lib ext_ldap.inc script begin Functions for LDAP authentication
extra/report/report.dao ext_report.inc script begin Funktionen für Reports
extra/explorer/filestructure.lib ext_explorer.inc script begin Functions for LIMBAS DMS
layout/nav.php ext_nav.inc script end Extension of the navigation bar
extra/multiframe/multiframe.dao ext_multiframe.inc script end Functions for displays in the multi-purpose window on the right edge of the browser
admin/setup/color_schema.lib ext_css.inc ext_scss.inc extscssv.inc script end Extension for overrides of the main stylesheet of Limbas (for direct layout adjustments)
main.php ext_main.css script middle Additionally 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".

Note:

Please bear in mind, that the select field is only available when the menue item has a unique action name.

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

Example:

<?php
echo "hello world";
?>

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".

Example: ext_main.inc:

 <?
   if($action == 'nav_myMenue' ){
   #require('a file you need');
   echo "hallo";
   $action='null';
 }
 ?>

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".

Extending the Stylesheet

The files 'ext_scss.inc' and 'ext_scssv.inc' get inserted as is (raw text) and then compiled to css. The 'ext_css.inc' gets interpreted as php file and executed. Everything what is written into the variable $buf will get appended to the css file. To apply the extension, the color scheme has to be regenerated.

Example:
ext_css.inc

<?php
$buf = ".lmbGtabmenuIcon-11{
    background-color: red;
}";