Adding items to the Shortcuts menu
Wednesday, August 27th, 2008Want to add items to the shortcut menu? No problem. Create the following file
custom/modules/<module name>/Ext/Menus/menu.ext.php
Here is an example of the contents:
<?php
$module_menu[] =Array(”index.php?module=Reports&action=index&view=contacts”, $mod_strings[’LNK_CONTACT_REPORTS’],”ContactReports”, ‘Contacts’);
$module_menu[] =Array(”javascript:SUGAR.subpanelUtils.loadSubpanelGroup(’Activities’);”, $mod_strings[’LBL_ACTIVITIES’],”Contacts”);
?>
The $module_menu array contains 4 elements:
- The first element is target of the click. It can either be a URL or Javascript
- The second element is the text to display in the menu. This must obviously be defined in a language file
- The third element is the icon to display next to the shortcut. The icons can be found in the themes\default\images directory.
- The fourth element (which is optional) is the name of the module.
In the examples above, the first line takes you to Contact Reports. The second example changes the tab in the detail view to make the Activities subpanel have focus