function lingotek_get_language_override_form_submit in Lingotek Translation 7.7
Same name and namespace in other branches
- 7.6 lingotek.module \lingotek_get_language_override_form_submit()
1 string reference to 'lingotek_get_language_override_form_submit'
- lingotek_get_language_override_form in ./
lingotek.module - Display the Lingotek language-override form field
File
- ./
lingotek.module, line 1160
Code
function lingotek_get_language_override_form_submit($form, $form_state) {
// Store the current language of the field data, if different from the stated node language.
if (!empty($form_state['node']->nid)) {
$source_node = lingotek_get_source_node($form_state['node']);
$stated_language = Lingotek::convertDrupal2Lingotek($form_state['node']->language);
$source_lang_metadata_key = 'source_language_' . $stated_language;
if (!empty($form_state['values']['language_override'])) {
lingotek_keystore('node', $source_node->nid, $source_lang_metadata_key, $form_state['values']['language_override']);
lingotek_keystore('node', $source_node->nid, $source_lang_metadata_key, $form_state['values']['language_override']);
}
else {
lingotek_keystore_delete('node', $source_node->nid, $source_lang_metadata_key);
}
}
}