function crm_core_relationship_preprocess_relationship in CRM Core 7
Same name and namespace in other branches
- 8.3 modules/crm_core_relationship/crm_core_relationship.module \crm_core_relationship_preprocess_relationship()
- 8 modules/crm_core_relationship/crm_core_relationship.module \crm_core_relationship_preprocess_relationship()
- 8.2 modules/crm_core_relationship/crm_core_relationship.module \crm_core_relationship_preprocess_relationship()
Implements hook_preprocess().
File
- modules/
crm_core_relationship/ crm_core_relationship.module, line 312 - CRM Core Relationship, handles relationship logic and API.
Code
function crm_core_relationship_preprocess_relationship(&$variables) {
$variables['view_mode'] = $variables['elements']['#view_mode'];
$variables['relationship'] = $variables['elements']['#relationship'];
$variables['language'] = $variables['elements']['#view_mode'];
$variables['content'] = relation_view($variables['relationship'], $variables['view_mode']);
$entity = $variables['relationship'];
// add classes based on the type of relation
$variables['classes_array'][] = 'relation';
$variables['classes_array'][] = 'relation-' . $entity->relation_type;
$variables['theme_hook_suggestions'][] = 'relationship__' . $entity->relation_type;
$variables['theme_hook_suggestions'][] = 'relationship__' . $entity->rid;
}