You are here

function lingotek_push_form_submit in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.7 lingotek.page.inc \lingotek_push_form_submit()
  2. 7.3 lingotek.page.inc \lingotek_push_form_submit()
  3. 7.4 lingotek.page.inc \lingotek_push_form_submit()
  4. 7.5 lingotek.page.inc \lingotek_push_form_submit()
  5. 7.6 lingotek.page.inc \lingotek_push_form_submit()

Submit handler for the lingotek_push_form form.

File

./lingotek.page.inc, line 38
Lingotek Tab for Nodes

Code

function lingotek_push_form_submit($form, $form_state) {
  $node = node_load($form_state['values']['node_id']);
  $api = LingotekApi::instance();
  if ($existing_document = lingotek_lingonode($node->nid, 'document_id')) {

    // Update an existing Lingotek Document.
    $api
      ->updateContentDocument($node);
  }
  else {

    // Create a new Lingotek Document.
    $api
      ->addContentDocument($node, TRUE);
  }
  drupal_set_message(t('Uploaded content for "@node_title" to Lingotek for translation.', array(
    '@node_title' => $node->title,
  )));
}