Menu File Format

Overview

Menus are stored in XML format to allow easy modification by you or third-party utilities.  Most elements are optional and will be assigned default values if unspecified.

Example XML

<?xml version="1.0"?>
<menu>

    <activity>Looking at games</activity>
    <allow-cancel>true</allow-cancel>
    <display-file>GAMES.ANS</display-file>
    <name>DoorMenu</name>

    <security>L10</security>

    <items>
        <item>
            <hotkey>L</hotkey>
            <command>RunDoor LORD</command>
        </item>
    </items>

</menu>

Menu Elements

activity

Optional.  If defined, the activity text of the user will be updated when the menu is executed.  For example, a file menu can set the user activity as "Browsing files...".

allow-cancel

Optional.  True if the user is allowed to cancel the menu.

border-style

Optional.  The style of the border.  Not all menu viewers recognize this setting; it is only useful when a viewer constructs a display based on the settings in the file.  Standard styles are None, Single and Double.  Different menu viewers may support other styles as well.

display-file

Optional.  The text file to display instead of using the built-in menu display.  This may be ignored by some menu viewers.

hotkey-color

Optional.  The default color of a hotkey character.  This may be ignored by some menu viewers.

name

Optional. An administrator-defined name of the menu.

onexit

Optional.  Commands to execute when the menu is exited.  See Verbs.

onload

Optional.  Commands to execute when the menu is loaded.  See Verbs.

security

Optional.  A security expression that controls visibility of the menu.  The expression is evaluated whenever the menu is requested.  A failed validation causes the security-notice text to be displayed.

security-text

Optional.  The prompt to display when a user is denied access to the menu.  This message is shown only when the user attempts to execute the menu option despite not seeing it on the screen (e.g. through a hotkey).  If blank, no message is shown (meaning, there is no indication that a menu option is even available).  Note: this message is not displayed if the underlying menu command fails to permit the user to proceed, e.g. a time bank bounces a new user.  This is because the menu (from its perspective) was able to run the underlying command.

text-color

Optional.  The default color of a text prompt for a menu item.  This may be ignored by some menu viewers.

Menu Item Elements

command

Required.  A command (verb) to execute when the menu item is executed.  Multiple commands will be executed in the order defined in the file.  See Verbs.

enabled

Optional; default true.  Enables or disables the menu item.  You can disable a menu item if you do not want it available but you do not want to delete its information from the menu file.  For example, if you run a fundraiser once a year, you might want to disable the menu item for most of the year while saving its information for easier activation later.

hotkey

Optional.  Defines the hotkey that can be pressed by the user to select the menu item.

left

Optional.  The position of the menu item in relation to the left side of the overall menu (not the screen itself).  Not all menu viewers recognize this option.

onblur

optional.  Commands to execute when the menu item loses focus.  This is not recognized by all menu viewers.

onfocus

Optional.  Commands to execute when the menu item receives focus.  This is not recognized by all menu viewers.

security

Optional.  A security expression that controls the visibility of the menu item.  This does not control the security of whatever resources are being accessed by the command.  For example, if the command executes the sysop pager script, a security expression here does not override any security settings checked by the script.  The security expression only controls the visibility of the menu item.

text

Required.  The display text of the menu item.

top

Optional.  The position of the menu item in relation to the top of the overall menu (not the screen itself).  Not all menu items recognize this option.

tooltip

Optional.  A short description for the user.

visible

Optional; default is true.  Indicates whether or not the menu item is visible.  An invisible menu item is typically used for cancel/escape keys.