Pluggable menus in Evolution

By default each plugin has a single menu entry for loading plugin main page (for each user access level).

Evolution skin supports adding more menu entries from plugins. This feature is called pluggable menus.

Enabling pluggable menus

Pluggable menus are enabled by adding extra configuration lines in plugin.conf file.

New entries are menu_admin, menu_reseller and menu_user. The value should be a relative path to a plugin script, which when executed would return additional menu entries in JSON format.

Example plugin.conf file:

...
menu_admin=images/menu.json
menu_reseller=images/menu.json
menu_user=images/menu.json

Adding these three lines will enable pluggable menus for all user levels and will instruct DirectAdmin to load static menu file from:

  • /usr/local/directadmin/plugins/{name}/images/menu.json

In this example menu is placed in ./images directory to prevent it being rendered inside the skin template used for showing plugin GUI.

Menu content can be generated dynamically by using plugin scripts in RAW mode.

Menu file should be a valid JSON document. It is an array of menu category objects. Structure of menu category object:

FieldTypeDescription
namestringVisible menu category text
iconURLURL used to load menu icon
entriesarray of objectsList menu menu entries in this menu category

Each category can include list or menu entries described by the menu entry object. Object structure:

FieldTypeDescription
namestringVisible menu entry text
iconURLLink to menu entry icon
hrefURLLink to open whem menu entry is clicked
newTabbooleanWhen true menu entry will be opened in a new tab, useful for external links or scripts working in RAW mode
updatesintegerWhen set to value other than 0 would show an extra icon to the menu entry hinting there are a given number of events inside

Example of static pluggable menu file:

[
  {
    "name": "Useful links",
    "icon": "https://directadmin.com/favicon.png",
    "entries": [
      {
        "name": "Google",
        "icon": "https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png",
        "href": "https://google.com",
        "newTab": true,
        "updates": 1
      },
      {
        "name": "Wikipedia",
        "icon": "https://en.wikipedia.org/static/favicon/wikipedia.ico",
        "href": "https://en.wikipedia.org",
        "newTab": false,
        "updates": 0
      }
    ]
  }
]
Last Updated: