function lingotek_push_form_submit in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lingotek.page.inc \lingotek_push_form_submit()
- 7.2 lingotek.page.inc \lingotek_push_form_submit()
- 7.3 lingotek.page.inc \lingotek_push_form_submit()
- 7.5 lingotek.page.inc \lingotek_push_form_submit()
- 7.6 lingotek.page.inc \lingotek_push_form_submit()
Submit handler for the lingotek_push_form form.
File
- ./
lingotek.page.inc, line 179 - Lingotek Tab for Nodes
Code
function lingotek_push_form_submit($form, $form_state) {
$node = lingotek_node_load_default($form_state['values']['node_id']);
// clear any caching from entitycache module
if (module_exists('entitycache')) {
cache_clear_all($node->nid, 'cache_entity_node');
}
$api = LingotekApi::instance();
if ($node->lingotek['sync_method'] == 1 && module_exists('workbench_moderation') && isset($node->workbench_moderation)) {
lingotek_lingonode($node->nid, 'workbench_moderate', '0');
}
if ($existing_document = isset($node->lingotek['document_id']) ? $node->lingotek['document_id'] : '') {
// Update an existing Lingotek Document.
$api
->updateContentDocument($node);
}
else {
// Create a new Lingotek Document.
lingotek_node_save_readonly($node);
$ln = LingotekNode::load($node);
$api
->addContentDocument($ln, TRUE);
}
drupal_set_message(t('Uploaded content for "@node_title" to Lingotek for translation.', array(
'@node_title' => $node->title,
)));
}