function _site_disclaimer_nid_all_translations in Site Disclaimer 7
Same name and namespace in other branches
- 6 site_disclaimer.module \_site_disclaimer_nid_all_translations()
Get an associative array of all node translations (keyed by language code)
2 calls to _site_disclaimer_nid_all_translations()
- _site_disclaimer_nodeapi_work in ./
site_disclaimer.module - _site_disclaimer_prep_allowed_paths in ./
site_disclaimer.admin.inc - Create 'site_disclaimer_allow_nodes' variable from links found in:
File
- ./
site_disclaimer.module, line 381 - This module adds Site Disclaimer to the registration page.
Code
function _site_disclaimer_nid_all_translations($nid) {
global $language;
$nids = empty($nid) ? array() : array(
$language->language => $nid,
);
if (!empty($nid) && module_exists('translation')) {
$translations = translation_node_get_translations($nid);
foreach ($translations as $langcode => $translation) {
$nids[$langcode] = $translation->nid;
}
}
return $nids;
}