You are here

function lingotek_translatable_field_column in Lingotek Translation 7.7

1 call to lingotek_translatable_field_column()
lingotek_xml_fields in ./lingotek.util.inc

File

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

Code

function lingotek_translatable_field_column($entity_type, $bundle, $field_name, $column_name, $field_type, $field_module) {

  // This variable may be overridden to include perhaps field columns
  // called 'url' or 'params' or etc.
  $translatable_field_columns = lingotek_get_translatable_field_columns($field_type, $field_module);

  // FORMAT FOR VARIABLE 'lingotek_translatable_field_columns_by_entity_type':
  // array(
  //   '[entity_type]' => array(
  //     '[bundle]' => array(
  //       '[field_name]' => array(
  //         '[column_name1]' => TRUE,
  //         '[column_name2]' => TRUE,
  //       ),
  //     ),
  //   ),
  // );
  $translatable_field_columns_by_entity_type = variable_get('lingotek_translatable_field_columns_by_entity_type', array());

  // If a field array is not empty for a given entity type, then look to it
  // for what field columns to include for a given entity type and bundle.
  // This way fields included by default may be excluded for specific bundles
  // and vice versa.
  if (!empty($translatable_field_columns_by_entity_type[$entity_type][$bundle][$field_name])) {
    return !empty($translatable_field_columns_by_entity_type[$entity_type][$bundle][$field_name][$column_name]);
  }
  else {
    return in_array($column_name, $translatable_field_columns);
  }
}