You are here

function redhen_contact_menu_local_tasks_alter in RedHen CRM 7

Implements hook_menu_local_tasks_alter().

Changing the redhen/contact/add menu item to type MENU_LOCAL_ACTION would break display of child items. Instead, dynamically add the local action.

File

modules/redhen_contact/redhen_contact.module, line 341
Module file for RedHen contacts.

Code

function redhen_contact_menu_local_tasks_alter(&$data, $router_item, $root_path) {

  // Add action link to 'redhen/contact/add' on 'redhen/contact' page.
  if ($root_path == 'redhen/contact') {
    $item = menu_get_item('redhen/contact/add');
    if ($item['access']) {
      $data['actions']['output'][] = array(
        '#theme' => 'menu_local_action',
        '#link' => $item,
      );
    }
  }
}