function crm_core_relationship_ui_menu in CRM Core 8.2
Same name and namespace in other branches
- 8.3 modules/crm_core_relationship_ui/crm_core_relationship_ui.module \crm_core_relationship_ui_menu()
- 8 modules/crm_core_relationship_ui/crm_core_relationship_ui.module \crm_core_relationship_ui_menu()
- 7 modules/crm_core_relationship_ui/crm_core_relationship_ui.module \crm_core_relationship_ui_menu()
Implements hook_menu().
File
- modules/
crm_core_relationship_ui/ crm_core_relationship_ui.module, line 9
Code
function crm_core_relationship_ui_menu() {
$items = array();
/*
* CRM Contact Relationships
*/
$relation_paths = array(
'no_contact' => 'crm-core/contact/relationship-add',
'contact' => 'crm-core/contact/%crm_core_contact/relationships/add',
);
foreach ($relation_paths as $key => $path) {
$items[$path] = array(
'title' => 'Add a relationship',
'description' => 'Add a relationship to this contact',
'page callback' => 'crm_core_relationship_ui_add_relationship',
'page arguments' => array(
$key == 'contact' ? 2 : NULL,
),
'access callback' => TRUE,
'type' => MENU_LOCAL_ACTION,
'file' => 'crm_core_relationship_ui.pages.inc',
'weight' => 10,
);
foreach (crm_core_relationship_get_relationships() as $type => $info) {
$items[$path . '/' . $type . '/%'] = array(
'title' => 'Add ' . $info->label,
'description' => 'Add a relationship to this contact',
'page callback' => 'crm_core_relation_entity_ui_get_form_wrapper',
'page arguments' => $key == 'contact' ? array(
2,
5,
6,
) : array(
NULL,
3,
4,
),
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => array(
NULL,
'create_view',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'crm_core_relationship_ui.pages.inc',
);
}
}
$items['crm-core/contact/%crm_core_contact/relationships/add/%relation_type/%/autocomplete'] = array(
'page callback' => 'crm_core_relationship_ui_add_relationship_autocomplete',
'page arguments' => array(
2,
5,
6,
),
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => array(
5,
'create',
),
'type' => MENU_CALLBACK,
'file' => 'crm_core_relationship_ui.pages.inc',
);
$items['crm-core/relationships/%relation_type/%/autocomplete'] = array(
'page callback' => 'crm_core_relationship_ui_add_relationship_autocomplete',
'page arguments' => array(
NULL,
2,
3,
),
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => array(
2,
'create',
),
'type' => MENU_CALLBACK,
'file' => 'crm_core_relationship_ui.pages.inc',
);
/*
* CRM Relationship types
*/
$items['admin/structure/crm-core/relationship-types'] = array(
'title' => 'CRM Core Relationship Types',
'description' => 'Manage relationship types.',
'page callback' => 'crm_core_relationship_ui_types_overview',
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => array(
NULL,
'admin',
),
'file' => 'crm_core_relationship_ui.admin.inc',
'type' => MENU_LOCAL_TASK,
);
$items['admin/structure/crm-core/relationship-types/add'] = array(
'title' => 'Add crm relationship type',
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => array(
NULL,
'admin',
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'crm_core_relationship_ui_type_form',
),
'type' => MENU_LOCAL_ACTION,
'file' => 'crm_core_relationship_ui.admin.inc',
);
$items['admin/structure/crm-core/relationship-types/manage/%crm_core_relationship_ui_relationship_type'] = array(
'title' => 'Edit crm relationship type',
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => array(
NULL,
'admin',
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'crm_core_relationship_ui_type_form',
5,
),
'file' => 'crm_core_relationship_ui.admin.inc',
'type' => MENU_CALLBACK,
);
$items['admin/structure/crm-core/relationship-types/manage/%crm_core_relationship_ui_relationship_type/delete'] = array(
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => array(
NULL,
'admin',
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'crm_core_relationship_ui_type_delete_confirm',
5,
),
'file' => 'crm_core_relationship_ui.admin.inc',
'type' => MENU_CALLBACK,
);
$items['crm-core/contact/%/relationships/%/active'] = array(
'title' => 'Toggle relationship status',
'access arguments' => array(
'edit relations',
),
'page callback' => 'crm_core_relationship_ui_toggle_relationship_status',
'page arguments' => array(
4,
TRUE,
),
'file' => 'crm_core_relationship_ui.pages.inc',
);
$items['crm-core/contact/%/relationships/%/inactive'] = array(
'title' => 'Toggle relationship status',
'access arguments' => array(
'edit relations',
),
'page callback' => 'crm_core_relationship_ui_toggle_relationship_status',
'page arguments' => array(
4,
FALSE,
),
'file' => 'crm_core_relationship_ui.pages.inc',
);
/**
* Relationship Edit/Delete section.
*/
$items['crm-core/contact/%/relationships/%relation/edit'] = array(
'title' => 'Edit',
'access arguments' => array(
'edit relations',
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'relation_edit_form',
4,
),
'type' => MENU_LOCAL_ACTION,
);
$items['crm-core/contact/%/relationships/%relation/delete'] = array(
'title' => 'Delete',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'relation_delete_confirm',
4,
),
'access arguments' => array(
'delete relations',
),
'weight' => 10,
'type' => MENU_LOCAL_ACTION,
);
return $items;
}