You are here

function og_role_watchdog_menu in Role Watchdog 6

Same name and namespace in other branches
  1. 6.2 modules/og_role_watchdog/og_role_watchdog.module \og_role_watchdog_menu()
  2. 7.2 modules/og_role_watchdog/og_role_watchdog.module \og_role_watchdog_menu()
  3. 7 modules/og_role_watchdog/og_role_watchdog.module \og_role_watchdog_menu()

Implement hook_menu

File

modules/og_role_watchdog/og_role_watchdog.module, line 14
Logs changes to user roles.

Code

function og_role_watchdog_menu() {
  $items = array();
  $role_grants_title = 'Role grants';
  if (module_exists('statistics')) {
    $role_grants_title = 'Track role grants';

    // The statistics module does not define a default local task, so we need to add one here.
    $items['node/%node/track/statistics'] = array(
      'title' => 'Track statistics',
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
  }
  $items['node/%node/track/role_grants'] = array(
    'title' => $role_grants_title,
    'page callback' => 'og_role_watchdog_report',
    'page arguments' => array(
      1,
    ),
    'access callback' => '_og_role_watchdog_node_grants_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'og_role_watchdog.pages.inc',
    'weight' => '10',
  );
  return $items;
}