Extensions Script Extensions Estimated reading: 4 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 NameExecutionFunctionalitysession_auth.libext_global.incscript beginGlobalmain.phpext_main.incscript middleHome Pagemain.phpext_main.jsscript endHome Page Javascript Body elementsmain_admin.phpext_main_admin.incscript middleAdmin Home Pagemain_dyns.phpext_ajax.incscript beginHome Page for Ajax-Callsgtab/gtab.libext_gtab.incscript beginBasic functions for all database queries and changesgtab/html/gtab_erg.phpext_gtab_erg.incscript beginFunctions for the list viewgtab/html/gtab_erg.daoext_gtab_erg_dao.incscript beginFunctions for the list viewgtab/dao/gtab_change.daoext_gtab_change.incscript beginFunctions for the detail viewlib/session_auth.libext_session_auth.incscript endFunctions for the Session Initializationlib/session_auth.libext_ldap.incscript beginFunctions for LDAP authenticationextra/report/report.daoext_report.incscript beginFunktionen für Reportsextra/explorer/filestructure.libext_explorer.incscript beginFunctions for LIMBAS DMSlayout/nav.phpext_nav.incscript endExtension of the navigation barextra/multiframe/multiframe.daoext_multiframe.incscript endFunctions for displays in the multi-purpose window on the right edge of the browseradmin/setup/color_schema.libext_css.incext_scss.incextscssv.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”. 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; }";