You are here

function globallink_get_all_translatable_taxonomy_types_and_names in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink_taxonomy/globallink_taxonomy.inc \globallink_get_all_translatable_taxonomy_types_and_names()
  2. 7.6 globallink_taxonomy/globallink_taxonomy.inc \globallink_get_all_translatable_taxonomy_types_and_names()
1 call to globallink_get_all_translatable_taxonomy_types_and_names()
globallink_field in ./globallink_field_configuration.inc
Renders form for globallink_field.

File

globallink_taxonomy/globallink_taxonomy.inc, line 805

Code

function globallink_get_all_translatable_taxonomy_types_and_names() {
  $override_localize = variable_get('globallink_override_localize', 0);
  $entity_version = system_get_info('module', 'entity_translation');
  $entity_info = entity_get_info('taxonomy_term');
  $arr = array();
  if (isset($entity_info) && isset($entity_info['bundles'])) {
    $bundles = $entity_info['bundles'];
    foreach ($bundles as $key => $bundle) {
      $vocab = taxonomy_vocabulary_machine_name_load($key);
      if ($entity_version['version'] == '7.x-1.0-beta5') {
        if ($vocab->i18n_mode == I18N_MODE_TRANSLATE || $vocab->i18n_mode == I18N_MODE_LOCALIZE && $override_localize == 1) {
          $arr['tax:' . $key] = $bundle['label'];
        }
      }
      else {
        if ($vocab->i18n_mode == I18N_MODE_TRANSLATE || $vocab->i18n_mode == I18N_MODE_ENTITY_TRANSLATION) {
          $arr['tax:' . $key] = $bundle['label'];
        }
      }
    }
    asort($arr);
  }
  return $arr;
}