You are here

function media_browser_plus_menu_local_tasks_alter in Media Browser Plus 7.3

Implements hook_menu_local_tasks_alter().

File

./media_browser_plus.module, line 103
Media Browser Plus - enhanced file management functions.

Code

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

  // Add action links on 'admin/content/file/mbp' page.
  // @todo can this be done in the related view?
  if ($root_path == 'admin/content/file/mbp') {
    $item = menu_get_item('file/add');
    if (!empty($item['access'])) {
      $data['actions']['output'][] = array(
        '#theme' => 'menu_local_action',
        '#link' => $item,
        '#weight' => $item['weight'],
      );
    }
    $item = menu_get_item('admin/content/file/import');
    if (!empty($item['access'])) {
      $data['actions']['output'][] = array(
        '#theme' => 'menu_local_action',
        '#link' => $item,
        '#weight' => $item['weight'],
      );
    }
  }
  if ($root_path == 'admin/content/file/mbp' || variable_get('media_browser_plus_thumbnails_as_default_browser', TRUE) && $root_path == 'admin/content/file') {
    $item = menu_get_item('admin/structure/taxonomy/media_folders');
    if (!empty($item['access'])) {
      $data['actions']['output'][] = array(
        '#theme' => 'menu_local_action',
        '#link' => $item,
        '#weight' => 10,
      );
    }
  }
}