You are here

function lingotek_translatable_types in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.util.inc \lingotek_translatable_types()
  2. 7.6 lingotek.util.inc \lingotek_translatable_types()

Return content types linked to 'translatable' fields for the given entity type.

1 call to lingotek_translatable_types()
lingotek_field_language_data_cleanup_batch_create in ./lingotek.batch.inc
Field Language Data Cleanup Utility

File

./lingotek.util.inc, line 660
Utility functions.

Code

function lingotek_translatable_types($entity_type) {
  $types = array();
  $entity_types = lingotek_translatable_field_details();
  if (!isset($entity_types[$entity_type])) {

    // No fields found for the given entity type.
    return $types;
  }
  foreach ($entity_types[$entity_type] as $field) {
    foreach ($field['bundles'] as $bundle) {
      $types[$bundle] = $bundle;
    }
  }
  if (count($types) > 0) {
    $types = array_keys($types);
  }
  return $types;
}