function _site_disclaimer_nid_translated in Site Disclaimer 6
Same name and namespace in other branches
- 7 site_disclaimer.module \_site_disclaimer_nid_translated()
Get translation of a node for the current language.
2 calls to _site_disclaimer_nid_translated()
- site_disclaimer_form_user_register_alter in ./
site_disclaimer.module - Implementation of hook_form_form_id_alter().
- _site_disclaimer_enabled in ./
site_disclaimer.module - Determine if site_disclaimer is enabled.
File
- ./
site_disclaimer.module, line 80 - This module adds Site Disclaimer to the registration page.
Code
function _site_disclaimer_nid_translated($nid) {
if ($nid != '' && module_exists('translation')) {
global $language;
$langcode = $language->language;
$translations = translation_node_get_translations($nid);
if (!empty($translations[$langcode])) {
$nid = $translations[$langcode]->nid;
}
}
return $nid;
}