You are here

function ack_menu_menu_alter in Access Control Kit 7

Implements hook_menu_alter().

File

ack_menu/ack_menu.module, line 108
The ACK menu module.

Code

function ack_menu_menu_alter(&$items) {

  // Override the menu admin overview page.
  $items['admin/structure/menu']['page callback'] = 'ack_menu_admin_page';
  $items['admin/structure/menu']['access callback'] = 'ack_menu_admin_access';
  $items['admin/structure/menu']['file'] = 'ack_menu.pages.inc';
  $items['admin/structure/menu']['file path'] = drupal_get_path('module', 'ack_menu');
  unset($items['admin/structure/menu']['access arguments']);

  // Override access to the menu admin list and add pages.
  $paths = array(
    'admin/structure/menu/manage/%menu',
    'admin/structure/menu/manage/%menu/add',
  );
  foreach ($paths as $path) {
    $items[$path]['access callback'] = 'ack_menu_menu_access';
    $items[$path]['access arguments'] = array(
      4,
    );
  }

  // Override access to the menu link edit and delete operations.
  foreach (array(
    'edit',
    'delete',
  ) as $op) {
    $items['admin/structure/menu/item/%menu_link/' . $op]['access callback'] = 'ack_menu_link_access';
    $items['admin/structure/menu/item/%menu_link/' . $op]['access arguments'] = array(
      4,
    );
  }
}