6.0.0-git
2024-04-19
Last Modified 2008-06-25 by Guest

Customizing menus

There are two main menus in Horde. Each module has it's own application menu on the top. And then there is what is called the "Sidebar", the menu on the left in a separate browser frame, which is always the same and contains links to the different Horde applications.

Application menus

The application menus are aggregated from several places. You can configure menus in three places:

  1. Horde Setup, where you can configure Help, Options, Problems, and Logout/Login menu items: you need to login as an administrator and then go to Administration -> Setup -> Horde -> Menu Settings
    1. Application Setup, where you can configure links to all installed applications and application-specific items: Adminstration -> Setup -> Application -> Menu Settings
    2. Arbitrary items: can be configured in config/menu.php. Copy menu.php.dist to menu.php, read the comments in the file header, and create your own menu entries

Sidebar

To add new items to the sidebar menu, you need to edit config/registry.php. Make sure to read the comments at the top of registry.php carefully. The only required configuration values for a menu entry are 'name' and 'status', but 'webroot' and 'fileroot' are useful entries.

Let's say you want to add a link to your intranet:


// Custom Menus

$this->applications['intranet'] = array(

     'name' => _('Intranet Links'),

     'status' => 'heading',

     'icon' => '',

);

$this->applications['intranet_link_1'] = array(

 'webroot' => 'https://www.example.com,

 'name' => _("Example Link"),

 'status' => 'active',

 'target' => '_parent',

 'menu_parent' => 'intranet',

 'fileroot' => '/tmp',

 'icon' => '',

);

This adds a top-level menu entry with the link text "Intranet Links" and a sub link to https://www.example.com to your sidebar. We also set the 'icon' value to an empty string. This is to keep the browser from loading an icon from a default location, creating a lot entries in your web server's error log. If you put an icon with a size of 16x16 pixel somewhere on your web server, you can put the (web) location into the 'icon' value, and it will be displayed in the menu.