You are here

function _entity_translation_field_desc in Entity Translation 7

Returns a human-readable, localized, bullet list of instances of a field.

Parameters

field: A field data structure.

Return value

A themed list of field instances with the bundle they are attached to.

2 calls to _entity_translation_field_desc()
entity_translation_form_field_ui_field_edit_form_alter in ./entity_translation.module
Implements hook_form_FORM_ID_alter().
entity_translation_translatable_form in ./entity_translation.admin.inc
Confirm form for changing field translatability.

File

./entity_translation.module, line 1759

Code

function _entity_translation_field_desc($field) {
  $instances = array();
  foreach ($field['bundles'] as $entity_type => $bundle_names) {
    $entity_type_info = entity_get_info($entity_type);
    foreach ($bundle_names as $bundle_name) {
      $instance_info = field_info_instance($entity_type, $field['field_name'], $bundle_name);
      $instances[] = t('@instance_label in %entity_label', array(
        '@instance_label' => $instance_info['label'],
        '%entity_label' => $entity_type_info['bundles'][$bundle_name]['label'],
      ));
    }
  }
  return theme('item_list', array(
    'items' => $instances,
  ));
}