You are here

function entity_translation_taxonomy_term_field_attach_submit in Entity Translation 7

Term-specific implementation of hook_field_attach_submit().

1 call to entity_translation_taxonomy_term_field_attach_submit()
entity_translation_field_attach_submit in ./entity_translation.module
Implementation of hook_field_attach_submit().

File

./entity_translation.taxonomy.inc, line 552
The taxonomy specific translation functions and hook implementations.

Code

function entity_translation_taxonomy_term_field_attach_submit($entity_type, $entity, $form, &$form_state) {

  // Finally save in-place translations
  if (!empty($form_state['entity_translation']['taxonomy_autocomplete'])) {
    foreach ($form_state['entity_translation']['taxonomy_autocomplete'] as $entity_type => $entity_type_data) {
      foreach ($entity_type_data as $id => $field_name_data) {
        foreach ($field_name_data as $field_name => $term_data) {
          if (!is_array($term_data)) {
            continue;
          }
          foreach ($term_data as $term) {
            entity_translation_entity_save('taxonomy_term', $term);
          }
        }
      }
    }
  }
}