You are here

function globallink_get_translatable_fields in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink.module \globallink_get_translatable_fields()
  2. 7.5 globallink.module \globallink_get_translatable_fields()

Gets translatable fields.

Parameters

string $type: The fields' content type.

bool $bundle: The field bundle name. Defaults to false.

Return value

array An array containing all fields of the specified type that are translatable.

3 calls to globallink_get_translatable_fields()
globallink_entity_node_presave in globallink_entity/globallink_entity.module
Implements hook_node_presave().
globallink_node_presave in ./globallink.module
Implements hook_node_presave().
globallink_node_type_update in ./globallink.module
Implements hook_node_type_update().

File

./globallink.module, line 1190
GlobalLink translation module.

Code

function globallink_get_translatable_fields($type, $bundle = FALSE) {
  $fields = array();
  if ($bundle) {
    $result = db_select('globallink_field_config', 'tfc')
      ->fields('tfc')
      ->condition('content_type', $type, '=')
      ->condition('bundle', $bundle, '=')
      ->execute();
  }
  else {
    $result = db_select('globallink_field_config', 'tfc')
      ->fields('tfc')
      ->condition('content_type', $type, '=')
      ->execute();
  }
  foreach ($result as $row) {
    $fields[] = $row;
  }
  return $fields;
}