function lingotek_entity_upload_triggered in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lingotek.module \lingotek_entity_upload_triggered()
- 7.5 lingotek.module \lingotek_entity_upload_triggered()
1 call to lingotek_entity_upload_triggered()
File
- ./
lingotek.module, line 1515
Code
function lingotek_entity_upload_triggered($entity, $entity_type, $changed = TRUE, &$context = array()) {
list($id, $vid, $bundle) = lingotek_entity_extract_ids($entity_type, $entity);
if (isset($entity->lingotek_upload_override)) {
if ($entity->lingotek_upload_override) {
lingotek_entity_upload($entity, $entity_type);
}
return;
}
if (!lingotek_enabled_bundle($entity_type, $bundle) && $entity->lingotek['profile'] == LingotekSync::PROFILE_DISABLED || !isset($entity->language) || !Lingotek::isSupportedLanguage($entity->language) && !($entity->language == LANGUAGE_NONE && $entity_type == 'taxonomy_term')) {
return;
}
if (isset($entity->lingotek['upload_status']) && $entity->lingotek['upload_status'] == LingotekSync::STATUS_TARGET) {
return;
}
if ($entity_type == 'node' && !empty($entity->tnid) && $entity->nid != $entity->tnid) {
//check to make sure it is not a target node
return;
}
if (!$changed && $entity->lingotek['upload_status'] == 'CURRENT') {
return;
//entity has no changes.
}
lingotek_keystore($entity_type, $id, 'upload_status', LingotekSync::STATUS_EDITED);
if ($entity->lingotek['create_lingotek_document']) {
lingotek_entity_upload($entity, $entity_type, $context);
}
}