SuiteCRM 8 Header Submenu External Link

45 views Asked by At

In SuiteCRM 8 I have added a submenu link under the 'Emails' header menu by creating the file public/legacy/custom/Extension/modules/Emails/Ext/Menus/menu.ext.php. The code I used works for internal navigation, but when I try to incorporate an external link, such as 'https://www.my-external-link.com' it stops SuiteCRM from working. How can I modify my code to enable the use of external links?

<?php
global $current_user;
global $mod_strings, $app_strings;
$module_menu = array();

// Each index of module_menu must be an array of:
// the link url, display text for the link, and the icon name.


if (ACLController::checkAccess('Emails', 'edit', true)) {
    $module_menu[]=array("index.php?module=Emails&action=ComposeView&return_module=Emails&return_action=index", $mod_strings['LNK_NEW_SEND_EMAIL'],"Create", 'Emails');
}
if (ACLController::checkAccess('Emails', 'list', true)) {
    $module_menu[]=array("index.php?module=Emails&action=index&return_module=Emails&return_action=DetailView", $mod_strings['LNK_VIEW_MY_INBOX'],"List", 'Emails');
}
if (ACLController::checkAccess('Emails', 'list', true)) {
    $module_menu[]=array("https://www.my-external-link.com", $mod_strings['LBL_LIST_STATUS'],"List", 'Emails');
}
?>
1

There are 1 answers

1
TSCAmerica.com On

I used Using JavaScript to open the external link in a new tab, hope this helps

<?php
global $current_user;
global $mod_strings, $app_strings;
$module_menu = array();

// Each index of module_menu must be an array of:
// the link url, display text for the link, and the icon name.


if (ACLController::checkAccess('Emails', 'edit', true)) {
    $module_menu[]=array("index.php?module=Emails&action=ComposeView&return_module=Emails&return_action=index", $mod_strings['LNK_NEW_SEND_EMAIL'],"Create", 'Emails');
}
if (ACLController::checkAccess('Emails', 'list', true)) {
    $module_menu[]=array("index.php?module=Emails&action=index&return_module=Emails&return_action=DetailView", $mod_strings['LNK_VIEW_MY_INBOX'],"List", 'Emails');
}
if (ACLController::checkAccess('Emails', 'list', true)) {
    $module_menu[]=array("javascript:void(window.open('https://www.my-external-link.com','_blank'));", $mod_strings['LBL_LIST_STATUS'],"List", 'Emails');
}
?>