You are here

function redhen_relation_menu in RedHen CRM 7

Implements hook_menu().

File

modules/redhen_relation/redhen_relation.module, line 15
Redhen CRM Relation Module.

Code

function redhen_relation_menu() {
  $items = array();

  // Contact connections.
  $items['redhen/contact/%redhen_contact/connections'] = array(
    'title' => 'Connections',
    'page callback' => 'redhen_relation_connections_page',
    'page arguments' => array(
      2,
      'redhen_contact',
    ),
    'access callback' => 'redhen_relation_access',
    'access arguments' => array(
      'view',
      2,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -5,
  );
  $items['redhen/contact/%redhen_contact/connections/add'] = array(
    'title' => 'Add Connection',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'redhen_relation_connection_form',
      2,
    ),
    'file' => 'includes/redhen_relation.forms.inc',
    'access callback' => 'redhen_relation_access',
    'access arguments' => array(
      'edit',
      2,
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['redhen/contact/%redhen_contact/connections/%relation/edit'] = array(
    'title' => 'Edit Connection',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'redhen_relation_connection_form',
      2,
      4,
    ),
    'file' => 'includes/redhen_relation.forms.inc',
    'access callback' => 'redhen_relation_entity_access',
    'access arguments' => array(
      'update',
      4,
    ),
    'type' => MENU_LOCAL_ACTION,
  );

  // Org connections.
  $items['redhen/org/%redhen_org/connections'] = array(
    'title' => 'Connections',
    'page callback' => 'redhen_relation_connections_page',
    'page arguments' => array(
      2,
      'redhen_org',
    ),
    'access callback' => 'redhen_relation_access',
    'access arguments' => array(
      'view',
      2,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -5,
  );
  $items['redhen/org/%redhen_org/connections/add'] = array(
    'title' => 'Add Connection',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'redhen_relation_connection_form',
      2,
    ),
    'file' => 'includes/redhen_relation.forms.inc',
    'access callback' => 'redhen_relation_access',
    'access arguments' => array(
      'edit',
      2,
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['redhen/relation/autocomplete/%'] = array(
    'title' => 'Autocomplete for RedHen Relations',
    'page callback' => 'redhen_relation_autocomplete',
    'page arguments' => array(
      3,
      4,
      5,
      6,
      7,
    ),
    // @todo Set permissions
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  return $items;
}