function entityconnect_eck_entityconnect_ref_fields_alter in Entity connect 7.2
Implements hook_entityconnect_get_ref_fields_alter().
File
- modules/
entityconnect_eck/ entityconnect_eck.module, line 6
Code
function entityconnect_eck_entityconnect_ref_fields_alter(&$ref_fields) {
foreach (field_info_fields() as $id => $field) {
// Add support for Entity reference module.
if ($field['type'] == 'entityreference' && $field['module'] == 'entityreference') {
$entity_reference_info = entityreference_get_selection_handler($field);
$entity_type = $entity_reference_info->field['settings']['target_type'];
// Entity construction kit support.
if (module_exists('eck')) {
$entity_info = entity_get_info($entity_type);
if (!empty($entity_info['module']) && $entity_info['module'] == 'eck') {
if (user_access('entityconnect add button') || user_access('entityconnect edit button')) {
$ref_fields[$id] = $field;
}
}
}
}
}
}