You are here

function forward_ds_fields_info in Forward 7.3

Same name and namespace in other branches
  1. 7.2 forward.module \forward_ds_fields_info()

Implements hook_ds_fields_info().

File

./forward.module, line 192
Allows forwarding of entities by email, and provides a record of how often each has been forwarded.

Code

function forward_ds_fields_info($entity_type) {
  $fields = array();
  $info = entity_get_info($entity_type);
  if (!empty($info['view modes']) && variable_get('forward_entity_' . $entity_type, FALSE)) {
    $ui_limit = array();
    foreach ($info['bundles'] as $key => $bundle) {
      if (variable_get('forward_' . $entity_type . '_' . $key, FALSE)) {
        $ui_limit[] = $key . '|*';
      }
    }
    $fields[$entity_type] = array();
    $fields[$entity_type]['forward_ds_field'] = array(
      'title' => t('Forward link'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'forward_ds_field_create',
      'ui_limit' => $ui_limit,
    );
  }
  return $fields;
}