How to add an actionmenu link?

Hi,

I wanted to add a new menu point in the actionmenu (sidebar) for the calendar module. My question is how do I add a new action to it?
My guess was that this menu is managed by the dropdown editor (module list especially) but I haven’t found anything helpful in there.
Any ideas?

Thanks in advance!

To add a new menu item for Calendar:

Create a new file in custom/Extension/Calendar/Ext/Menus/

Example below adds Create Account to Menu

<?php 
global $mod_strings, $app_strings;
iif(ACLController::checkAccess('Accounts', 'edit', true))$module_menu[] = Array("index.php?module=Accounts&action=EditView&return_module=Accounts&return_action=DetailView", $mod_strings['LNK_NEW_ACCOUNT'],"CreateAccounts", 'Accounts');
?>

then do a repair

1 Like

Thank you Mike, it worked like charm.
If you could please tell me how to add an icon next to the $mod_string?

Cheers,

Sebastian

Do you mean add an icon to the menu?

Sorry not sure how todo that

Yes i mean how to add an icon to the menu.
No problem.

You can simply add a class to the menu link e.g.:

<?php 
global $mod_strings, $app_strings;
if (ACLController::checkAccess('Accounts', 'edit', true)) {
    $module_menu[] = array(
        '"index.php?module=Accounts&action=EditView&return_module=Accounts&return_action=DetailView" class="side-bar-Create"',
        $mod_strings['LNK_NEW_ACCOUNT'],
        "CreateAccounts",
        'Accounts'
    );
}
?>

My post above was not correct. But somehow I am not allowed to edit it so:

A class automatically created. The class is side-bar- plus the 2nd index of the $module_menu array.

So in this example:

<?php 
global $mod_strings, $app_strings;
if (ACLController::checkAccess('Accounts', 'edit', true)) {
    $module_menu[] = array(
        "index.php?module=Accounts&action=EditView&return_module=Accounts&return_action=DetailView",
        $mod_strings['LNK_NEW_ACCOUNT'],
        "CreateAccounts",
        'Accounts'
    );
}
?>

The class would be side-bar-CreateAccounts.