You are here

function globallink_is_field_configured_for_translation in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink.inc \globallink_is_field_configured_for_translation()
  2. 7.6 globallink.inc \globallink_is_field_configured_for_translation()

Determines whether or not a field is configured for translation.

Parameters

string $entity_type: The field's entity type.

string $bundle_name: The name of the bundle.

string $field_name: The field's name.

string $content_type: The field's content type.

Return value

True if the field is configured for translation.

5 calls to globallink_is_field_configured_for_translation()
globallink_entity_generate_xml_document in globallink_entity/globallink_entity.inc
Generates XML document for entity.
globallink_entity_traverse_fields_and_field_collections in globallink_entity/globallink_entity.inc
Traverses entity fields and field collections.
globallink_form_field_ui_field_edit_form_alter in ./globallink.module
Implements hook_form_FORM_ID_alter().
globallink_generate_xml_document in ./globallink_node.inc
Builds XML document with translation data.
globallink_traverse_fields_and_field_collections in ./globallink_node.inc
Recursively adds fields and field collections to translation XML document.

File

./globallink.inc, line 919
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_is_field_configured_for_translation($entity_type, $bundle_name, $field_name, $content_type) {
  $result = db_select('globallink_field_config', 'tf')
    ->fields('tf')
    ->condition('content_type', $content_type, '=')
    ->condition('entity_type', $entity_type, '=')
    ->condition('bundle', $bundle_name, '=')
    ->condition('field_name', $field_name, '=')
    ->execute();
  foreach ($result as $row) {
    if ($row->translatable == 1) {
      return TRUE;
    }
  }
  return FALSE;
}