function crm_core_relationship_entity_info_alter in CRM Core 8.3
Same name and namespace in other branches
- 8 modules/crm_core_relationship_ui/crm_core_relationship_ui.module \crm_core_relationship_entity_info_alter()
- 8.2 modules/crm_core_relationship_ui/crm_core_relationship_ui.module \crm_core_relationship_entity_info_alter()
- 7 modules/crm_core_relationship_ui/crm_core_relationship_ui.module \crm_core_relationship_entity_info_alter()
Implements hook_entity_info_alter().
File
- modules/
crm_core_relationship_ui/ crm_core_relationship_ui.module, line 176 - Relationship UI module hooks.
Code
function crm_core_relationship_entity_info_alter(&$entity_info) {
// We are only altering the admin path for CRM relationship types.
foreach (RelationType::loadMultiple() as $type => $info) {
if (crm_core_relationship_is_relationship_type($type)) {
$entity_info['relation']['bundles'][$type]['label'] = $type;
$entity_info['relation']['bundles'][$type]['admin'] = [
'path' => 'admin/structure/crm-core/relationship-types/manage/%relation_type',
'real path' => 'admin/structure/crm-core/relationship-types/manage/' . $type,
'bundle argument' => 5,
'access callback' => 'crm_core_relationship_access_permissions',
'access arguments' => [
NULL,
'admin',
],
];
}
}
}