You are here

function forward_ds_field_create in Forward 7.3

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

Callback for Display Suite field.

1 string reference to 'forward_ds_field_create'
forward_ds_fields_info in ./forward.module
Implements hook_ds_fields_info().

File

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

Code

function forward_ds_field_create($field) {
  $output = '';
  if (user_access('access forward')) {
    $entity_type = $field['entity_type'];
    $entity = $field['entity'];
    if (variable_get('forward_entity_' . $entity_type, FALSE)) {
      list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
      if (variable_get('forward_' . $entity_type . '_' . $bundle, FALSE)) {
        $output = theme('forward_link', array(
          'entity_type' => $entity_type,
          'entity' => $entity,
        ));
      }
    }
  }
  return $output;
}