You are here

function i18n_sync_node_update in Internationalization 7

Implements hook_node_update().

1 call to i18n_sync_node_update()
i18n_sync_node_insert in i18n_sync/i18n_sync.module
Implements hook_node_insert().

File

i18n_sync/i18n_sync.module, line 184
Internationalization (i18n) package. Synchronization of translations

Code

function i18n_sync_node_update($node) {

  // Let's go with field synchronization.
  if (i18n_sync_node_check($node) && !empty($node->tnid) && (!variable_get('i18n_sync_source_' . $node->type, TRUE) || $node->tnid == $node->nid) && ($fields = i18n_sync_node_fields($node->type)) && ($translations = i18n_sync_node_get_translations($node, TRUE))) {
    $do_sync = TRUE;
    if (module_exists('entity_translation')) {
      if (entity_translation_enabled_bundle('node', $node->type)) {
        $do_sync = FALSE;
      }
    }
    if ($do_sync) {
      module_load_include('node.inc', 'i18n_sync');
      i18n_sync_node_translation($node, $translations, $fields, 'update');
    }
  }
}