You are here

function lingotek_node_update in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 6 lingotek.module \lingotek_node_update()
  2. 7.2 lingotek.module \lingotek_node_update()
  3. 7.3 lingotek.module \lingotek_node_update()

Implements hook_node_update().

1 call to lingotek_node_update()
lingotek_node_insert in ./lingotek.module
Implements hook_node_insert().

File

./lingotek.module, line 1273

Code

function lingotek_node_update($node) {

  // check to make sure Lingotek is enabled and supporting the given node type or profile
  if (!lingotek_supported_type($node->type) && (!isset($node->lingotek) || $node->lingotek['profile'] == LingotekSync::PROFILE_DISABLED)) {
    return;
  }

  //check to make sure it is not a target node
  if (!empty($node->tnid) && $node->nid != $node->tnid) {
    return;
  }
  $node = lingotek_node_save($node);
  if (module_exists('workbench_moderation') && isset($node->workbench_moderation)) {
    if (isset($node->is_new) && $node->is_new) {
      lingotek_workbench_moderation_transition($node, $node->workbench_moderation['current']->from_state, $node->workbench_moderation['current']->state);
    }
    else {
      return;
    }
  }
  else {
    lingotek_upload_document($node);
  }
}