function entityconnect_bean_entityconnect_ref_fields_alter in Entity connect 7.2
Implements hook_entityconnect_get_ref_fields_alter().
File
- modules/
entityconnect_bean/ entityconnect_bean.module, line 6
Code
function entityconnect_bean_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'];
// Bean support.
if (module_exists('bean_admin_ui')) {
$entity_info = entity_get_info($entity_type);
if (!empty($entity_info['module']) && $entity_info['module'] == 'bean') {
if (user_access('entityconnect add button') || user_access('entityconnect edit button')) {
$ref_fields[$id] = $field;
}
}
}
}
}
}