summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.18/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.18/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module')
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module26
1 files changed, 14 insertions, 12 deletions
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module b/kolab.org/www/drupal-7.18/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module
index d5c1793..0a051b2 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module
@@ -184,11 +184,11 @@ function i18n_taxonomy_field_formatter_info() {
}
/**
-- * Implements hook_field_formatter_prepare_view().
-- *
-- * This preloads all taxonomy terms for multiple loaded objects at once and
-- * unsets values for invalid terms that do not exist.
-- */
+ * Implements hook_field_formatter_prepare_view().
+ *
+ * This preloads all taxonomy terms for multiple loaded objects at once and
+ * unsets values for invalid terms that do not exist.
+ */
function i18n_taxonomy_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) {
return taxonomy_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, $items, $displays);
}
@@ -318,7 +318,7 @@ function i18n_taxonomy_field_storage_details_alter(&$details, &$field) {
/**
* Implements hook_field_attach_prepare_translation_alter().
-
+ *
* Prepare and synchronize translation for term reference fields.
*/
function i18n_taxonomy_field_attach_prepare_translation_alter(&$entity, $context) {
@@ -468,7 +468,8 @@ function i18n_taxonomy_theme() {
* Get localized term name unfiltered.
*/
function i18n_taxonomy_term_name($term, $langcode = NULL) {
- return i18n_taxonomy_vocabulary_mode($term->vid, I18N_MODE_LOCALIZE) ? i18n_string(array('taxonomy', 'term', $term->tid, 'name'), $term->name, array('langcode' => $langcode, 'sanitize' => FALSE)) : $term->name;
+ $key = i18n_object_info('taxonomy_term', 'key');
+ return i18n_taxonomy_vocabulary_mode($term->vid, I18N_MODE_LOCALIZE) ? i18n_string(array('taxonomy', 'term', $term->{$key}, 'name'), $term->name, array('langcode' => $langcode, 'sanitize' => FALSE)) : $term->name;
}
@@ -476,7 +477,8 @@ function i18n_taxonomy_term_name($term, $langcode = NULL) {
* Get localized term description unfiltered.
*/
function i18n_taxonomy_term_description($term, $langcode = NULL) {
- return i18n_taxonomy_vocabulary_mode($term->vid, I18N_MODE_LOCALIZE) ? i18n_string(array('taxonomy', 'term', $term->tid, 'description'), $term->description, array('langcode' => $langcode, 'sanitize' => FALSE)) : $term->description;
+ $key = i18n_object_info('taxonomy_term', 'key');
+ return i18n_taxonomy_vocabulary_mode($term->vid, I18N_MODE_LOCALIZE) ? i18n_string(array('taxonomy', 'term', $term->{$key}, 'description'), $term->description, array('langcode' => $langcode, 'sanitize' => FALSE)) : $term->description;
}
/**
@@ -1260,10 +1262,10 @@ 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);
- }
+ if ($field['type'] == 'taxonomy_term_reference') {
+ $field['settings']['options_list_callback'] = 'i18n_taxonomy_allowed_values';
+ field_update_field($field);
}
+ }
}
}