menu.xml - adding new menu items

One of the main adaptation files is menu.xml, her you can modify the menu and also add completely new menus called in from somewhere. If you want to have a menu associated with a form, name the menu "form_tablename" where the form is called "tablename.frm" and the table it uses is called "tablename".

Four different kind of files can be added to a menu, forms, wizards, html files and php files. PHP files will get data from the menu in the $_REQUEST variable, some values are added there before it's called by the underlying system.

Forms are defined as above and should be linked by name only, the system will search through local versions of the form first and only if none is found load a default template. If there is no template available, one will be generated using available metadata. For simple records it's enough to add labels to the database structure to have the form generated automatically.

Wizards are added the same way, simple link the wizard file as file link to have it included.

PHP and HTML files can be added directly, if it's added to a menu of a form record the information to recover the record is available in the $_REQUEST variable. Clicking links and submitting forms will reload the same page again, if you wish to link outside the page use the class="download" on the link to avoid it being rewritten. Normally the text in the html and php is returned wrapped in a menu, but's also possible to override that and generate a dynamic menu from a php file, if you decide to make us of this the format is explained below.

Menu JSON format

This section describes the menu format sent from the server to the browser client.

{ menu:
{ name: 'item 1 in menu', link: 'url 1 to load' },
{ name: 'item 2 in menu', link: 'url 2 to load' },
{ name: 'item n in menu', link: 'url n to load' }
title: 'Title above menu' ,
page: 'filename of loaded file' ,
pagedata: 'htmlcode to insert' ,
id: 'id in menu of this choice' }

As can be seen it's a pretty simple format, the url in item originating from the menu.xml has a special format, but it's possible to put anything you want in there. If you want to call another section of the menu the format has to follow what is used elsewhere however.

To return a structure like this from PHP code to make a dynamic part of the menu, prefix the structure with {%menuoverride%} followed directly by a structure like the one above.