You are here

function content_menu_menu_local_tasks_alter in Content Menu 7

Implements hook_menu_local_tasks_alter().

Remove the "Add link" link on menu listing page, since we add a "New item" row and form element, which cares for adding new items.

File

./content_menu.module, line 359
Main code for the content_menu.module.

Code

function content_menu_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  if (strpos(current_path(), 'admin/structure/menu/manage/') === 0) {
    if (variable_get('content_menu_alter_all_menus', CONTENT_MENU_ALTER_ALL_MENUS) || content_menu_is_menu_considered(arg(4))) {
      foreach ($data['actions']['output'] as $key => $action) {
        if ($action['#link']['path'] == 'admin/structure/menu/manage/%/add') {
          unset($data['actions']['output'][$key]);
        }
      }
    }
  }
}