You are here

public function GroupMembershipUIController::hook_menu in Group 7

Provides definitions for implementing hook_menu().

Overrides EntityDefaultUIController::hook_menu

File

classes/group_membership.ui_controller.inc, line 39
Defines the Entity API UI class for group memberships.

Class

GroupMembershipUIController
UI class for group memberships.

Code

public function hook_menu() {
  $items[$this->path] = array(
    'title' => 'Group members',
    'description' => 'Manage group membership fields and display',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'group_membership_overview_form',
      'group_membership',
    ),
    'access arguments' => array(
      'configure group module',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
  );

  // Set up a dummy menu item so the Field UI tabs show up correctly.
  $items["{$this->path}/manage/group_membership"] = array(
    'title' => 'Manage defaults',
    'description' => 'Manage default group membership fields and display',
    'page callback' => 'drupal_goto',
    'page arguments' => array(
      $this->path,
    ),
    'access arguments' => array(
      'configure group module',
    ),
  );

  // Below are router definitions for individual group memberships.
  $items['group/%group/member'] = array(
    'title' => 'Members',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'group_member_overview_form',
      1,
    ),
    'access callback' => 'group_access',
    'access arguments' => array(
      'access member overview',
      1,
    ),
    'file' => 'admin/group_membership.inc',
    'file path' => drupal_get_path('module', 'group'),
    'type' => MENU_LOCAL_TASK,
    'weight' => 0,
  );
  $items['group/%group_membership/member/%'] = array(
    'title callback' => 'group_membership_page_title',
    'title arguments' => array(
      1,
    ),
    'page callback' => 'group_membership_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'group_membership_access',
    'access arguments' => array(
      'view',
      1,
    ),
    'file' => 'pages/group_membership.inc',
    'file path' => drupal_get_path('module', 'group'),
    'load arguments' => array(
      3,
    ),
  );
  $items['group/%group_membership/member/%/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['group/%group_membership/member/%/metadata'] = array(
    'title' => 'Metadata',
    'page callback' => 'group_membership_metadata',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'group_membership_access',
    'access arguments' => array(
      'metadata',
      1,
    ),
    'file' => 'pages/group_membership.inc',
    'file path' => drupal_get_path('module', 'group'),
    'load arguments' => array(
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
  );
  $items['group/%group_membership/member/%/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'entity_ui_get_form',
    'page arguments' => array(
      'group_membership',
      1,
    ),
    'access callback' => 'group_membership_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'forms/group_membership.inc',
    'file path' => drupal_get_path('module', 'group'),
    'load arguments' => array(
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
  );
  $items['group/%group_membership/member/%/cancel'] = array(
    'title' => 'Cancel membership',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'group_membership_cancel_form',
      1,
    ),
    'access callback' => 'group_membership_access',
    'access arguments' => array(
      'delete',
      1,
    ),
    'file' => 'admin/group_membership.inc',
    'file path' => drupal_get_path('module', 'group'),
    'load arguments' => array(
      3,
    ),
    'type' => MENU_CALLBACK,
  );

  // Below are router definitions for joining a group.
  $items['group/%group/member/%user/join'] = array(
    'title' => 'Join group',
    'title callback' => 'group_membership_join_title',
    'title arguments' => array(
      1,
    ),
    'page callback' => 'group_membership_join_form_builder',
    'page arguments' => array(
      1,
      3,
      'group_membership_join_form',
    ),
    'access callback' => 'group_membership_join_form_access',
    'access arguments' => array(
      1,
      3,
    ),
    'file' => 'forms/group_membership.inc',
    'file path' => drupal_get_path('module', 'group'),
    'type' => MENU_CALLBACK,
  );
  $items['group/%group/member/%user/request'] = array(
    'title' => 'Request group membership',
    'title callback' => 'group_membership_request_title',
    'title arguments' => array(
      1,
    ),
    'page callback' => 'group_membership_join_form_builder',
    'page arguments' => array(
      1,
      3,
      'group_membership_request_form',
    ),
    'access callback' => 'group_membership_request_form_access',
    'access arguments' => array(
      1,
      3,
    ),
    'file' => 'forms/group_membership.inc',
    'file path' => drupal_get_path('module', 'group'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}