You are here

function file_entity_menu_local_tasks_alter in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.module \file_entity_menu_local_tasks_alter()

Implements hook_menu_local_tasks_alter().

File

./file_entity.module, line 415
Extends Drupal file entities to be fieldable and viewable.

Code

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

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