You are here

function workbench_access_menu_alter in Workbench Access 7

Implements hook_menu_alter().

If Workbench is disabled, modify the menu.

File

./workbench_access.module, line 134
Workbench Access module file.

Code

function workbench_access_menu_alter(&$items) {

  // Hide our taxonomy view pages.
  $items['taxonomy/term/%taxonomy_term']['access callback'] = 'workbench_access_taxonomy_page_access';
  $items['taxonomy/term/%taxonomy_term']['access arguments'] = array(
    2,
  );

  // It is possible that another module added this item.
  if (isset($items['admin/config/workbench'])) {
    return;
  }

  // Add a top-level menu item if one does not exist.
  $items['admin/config/workbench'] = array(
    'title' => 'Workbench',
    'description' => 'Workbench configuration',
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => array(
      'administer site configuration',
    ),
    'position' => 'right',
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
  );
}