Technical data

8. Documentation for Developers
httpd-menu.sh add [-p <priority>] <link> <name> [section] [realm]
Thus, an entry with the name <name> is inserted to the [section]. If [section] is omitted,
it will be inserted in the section “OPT-Packages” as default. <link> specifies the target of the
new link. <priority> specifies the priority of a menu item in its section. If not set, the default
priority used is 500. The priority should be a three digit number. The lower the priority, the
higher the link is placed in the section. If an entry should be placed as far down as possible
the priority to choose is e.g. 900. Entries with the same priority are sorted by the target of
the link. In [realm] the range is specified for which a logged-in user must have view rights so
the item is displayed for him. If [realm] is not specified, the menu item is always displayed.
For this, see also the section “User access rights” (Page 328).
Example:
httpd-menu.sh add "newfile.cgi" "Click here" "Tools" "tools"
This example creates a link named “Click here” with the target “newfile.cgi” in the section
“Tools” which will be created if not present.
The script may also delete entries from a menu:
httpd-menu.sh rem <link>
By executing this the entry containing the link <link> will be deleted.
Important: If several entries have the same link target file they will all be removed from
the menu.
Since sections can have priorities they can also be created manually. If a section was created
automatically when adding a menu entry it defaults to priority 500. The syntax for creating
sections is as follows:
httpd-menu.sh addsec <priority> <name>
<priority> should only be a three digit number.
In order to create meaningful priorities it is worthwhile to have a look at the file
/etc/httpd/menu of fli4l during runtime, priorities are placed in the second column.
A short description of the file format of the file menu follows for completeness. Those
satisfied with the function of httpd-menu.sh may skip this section. The file /etc/httpd/menu
is divided into four columns. The first column is a letter identifying the line as a heading or a
menu entry. The second column is the sort priority. The third column contains the target of
the link for entries and for headlines a hyphen, as this field has no meaning for headings. The
rest of the line is the text that will appear in the menu.
Headings use the letter “t”, a new menu section will be started then. Normal menu items
use the letters “e”. An example:
t 300 - My beautiful OPT
e 200 myopt1.cgi Do something beautiful
e 500 myopt1.cgi?more=yes Do something even more beautiful
When editing this file you have to be aware that the script httpd-menu.sh always stores
the file sorted. The individual sections are sorted and the entries in this section are sorted
too. The sorting algorithm can be stolen from httpd-menu.sh, however, it would be better to
expand the script itself with possible new functions, so that all menu-editing takes place at a
central location.
324