You are here

function ad_owners_menu in Advertisement 7

Same name and namespace in other branches
  1. 6.3 owners/ad_owners.module \ad_owners_menu()
  2. 6 owners/ad_owners.module \ad_owners_menu()
  3. 6.2 owners/ad_owners.module \ad_owners_menu()

Implementation of hook_menu().

File

owners/ad_owners.module, line 27
Enhances the ad module to support ad owners.

Code

function ad_owners_menu() {
  $items = array();
  $items['node/%node/adowners'] = array(
    'title' => 'Ad owners',
    'page callback' => 'ad_owners_overview',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'ad_owners_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
  );
  $items['node/%node/adowners/list'] = array(
    'title' => 'List',
    'access callback' => 'ad_permission',
    'access arguments' => array(
      1,
      'manage owners',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
  );
  $items['node/%node/adowners/%user/permissions'] = array(
    'title callback' => 'owner_permissions_title',
    'title arguments' => array(
      '!owner' => 3,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ad_owner_permissions_form',
      1,
      3,
    ),
    'access callback' => 'ad_permission',
    'access arguments' => array(
      1,
      'manage owners',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items['node/%node/adowners/%user/remove'] = array(
    'title' => 'Remove owner',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ad_owner_remove_form',
      1,
      3,
    ),
    'access callback' => 'ad_permission',
    'access arguments' => array(
      1,
      'manage owners',
    ),
    'type' => MENU_CALLBACK,
    'weight' => 6,
  );
  $items['node/%node/adowners/add'] = array(
    'title' => 'Add owner',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ad_owners_add_form',
      1,
    ),
    'access callback' => 'ad_permission',
    'access arguments' => array(
      1,
      'manage owners',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  return $items;
}