You are here

function i18n_taxonomy_modules_enabled in Internationalization 7

Implements hook_module_enabled().

Updates options_list_callback for taxonomy term fields.

Parameters

$modules:

File

i18n_taxonomy/i18n_taxonomy.module, line 1298
i18n taxonomy module

Code

function i18n_taxonomy_modules_enabled($modules) {
  $modules = drupal_map_assoc($modules);
  if (isset($modules['i18n_taxonomy'])) {
    foreach (field_info_fields() as $fieldname => $field) {
      if ($field['type'] == 'taxonomy_term_reference') {
        $field['settings']['options_list_callback'] = 'i18n_taxonomy_allowed_values';
        field_update_field($field);
      }
    }
  }
}