Expand Table Menu

Geschätzte Lektüre: 3 Minuten

The Menu items of table forms or reports can be expanded with custom functions. The extensions can be added using the following Script Extensions:

  • ext_gtab.inc
  • ext_gtab_erg.inc
  • ext_gtab_change.inc.

To add a Menu item in LIMBAS,

  • Create a function (with any function name)
    • Specify details with the following transfer parameters:
      • $gtabid: Table ID of the current table
      • $formid: Formular-Id des aktuell verwendeten Formulars, im Falle des Standardformulars “null”
      • $ID: Data record ID of the current data record, only for Record View
      • &$gresult: Points to the result of the last database query
    • Define the appearance of the new Menu item. Define the action performed: JavaScript statement(s) or function(s) that runs when selecting the new Menu item. Information can be returned to LIMBAS via hidden HTML form elements (hidden) in the HTML object “span id =”myExtForms””LIMBAS.

For this purpose, the ‘pop_ * menu functions’ are used, from the file ./limbas_src/lib/context.lib . Further settings for the display, as well as the JavaScript statements/functions, are passed on to the function as parameters.

  • Assign a new function to a table and a menu using the following command.
if(!$gLmbExt[$menuToBeExtended][$gtabid]){
	$gLmbExt[$menuToBeExtended][$gtabid] = $functionName;
}

This corresponds to

  • $gtabid: Table ID of the table, the menu item is added
  • $menuToBeExtended: One of the following values, which specifies the menu to be extended:
    • “menuChangeCInfo” → Menu item is added to the [file] → [info] menu of the edit and Record Riew
    • “menuChangeCContext” → Menu item is added to the [file] menu of the edit and Record View
    • “menuChangeCDisplay” → Menu item is added to the [view] menu of the edit and Record View
    • “menuChangeCExtras” → Menu item is added to the [extras] menu of the edit and Record View
    • “menuChangeCReport” → Menu item is added to the [extras] → [reports] menu of the edit and Record View
    • “menuChangeItems” → Menu item is added to the Main Menu of the edit and Record View
    • “menuChangeIcons” → Menu item is added to the toolbar in the edit and Record View
    • “menuListCInfo” → Menu item is added to the context menu of the [info] menu in the Record List
    • “menuListCContext” → Menu item is added to the context menu in the Record List
    • “menuListCDisplay” → Menu item is added to the [view] menu in the Record List
    • “menuListCExtras” → Menu item is added to the [extras] menu in the Record List
    • “menuListCReport” → Menu item is added to the [extras] [reports] menu in the Record List
  • $functionName: Name of the function, displayed in the menu
Share this Doc

Expand Table Menu

Or copy link

CONTENTS