Projet

Général

Profil

Révision 8c72e82a

Ajouté par Assos Assos il y a environ 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module
377 377
 *   The array of valid terms for this field, keyed by term id.
378 378
 */
379 379
function i18n_taxonomy_allowed_values($field) {
380
  global $language;
380 381
  $options = array();
381 382
  foreach ($field['settings']['allowed_values'] as $tree) {
382 383
    if ($vocabulary = taxonomy_vocabulary_machine_name_load($tree['vocabulary'])) {
383
      if ($terms = taxonomy_get_tree($vocabulary->vid, $tree['parent'])) {
384
      if (i18n_taxonomy_vocabulary_mode($vocabulary->vid) == I18N_MODE_TRANSLATE) {
385
        $parent = i18n_taxonomy_translation_term_tid($tree['parent'], NULL, $tree['parent']);
386
        $language = i18n_language_context();
387
        $terms = i18n_taxonomy_get_tree($vocabulary->vid, $language->language, $parent);
388
      }
389
      else {
390
        $terms = taxonomy_get_tree($vocabulary->vid, $tree['parent']);
391
      }
392
      if ($terms) {
384 393
        foreach ($terms as $term) {
385 394
          $options[$term->tid] = str_repeat('-', $term->depth) . i18n_taxonomy_term_name($term);
386 395
        }

Formats disponibles : Unified diff