function lingotek_node_presave in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lingotek.module \lingotek_node_presave()
- 7.2 lingotek.module \lingotek_node_presave()
- 7.3 lingotek.module \lingotek_node_presave()
- 7.4 lingotek.module \lingotek_node_presave()
- 7.5 lingotek.module \lingotek_node_presave()
Implements hook_node_presave.
File
- ./
lingotek.module, line 1348
Code
function lingotek_node_presave($node) {
// Make sure the title isn't overwritten with the translation when using the title module.
if (module_exists('title') && array_key_exists('title_field', $node)) {
if (isset($node->title_field[$node->language][0]['value'])) {
$node->title = $node->title_field[$node->language][0]['value'];
}
}
// Setting node menu language to neutral, so that it can be localized.
if (isset($node->menu)) {
$link = $node->menu;
if (lingotek_translate_menu_link($link)) {
$node->menu['language'] = LANGUAGE_NONE;
}
}
}