diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
commit | 18d22419f3da39ca4bf92f46d605a25957f311be (patch) | |
tree | d72732b1a23d479c4f2adc4d671d8ec901e2a187 /modules/translation/translation.module | |
parent | 9fe9144ae7804e3b80c0ffd8444b0448261f4436 (diff) | |
download | brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.gz brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.bz2 |
- Patch #339929 by Moshe et al: move node links into ->content.
Diffstat (limited to 'modules/translation/translation.module')
-rw-r--r-- | modules/translation/translation.module | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/translation/translation.module b/modules/translation/translation.module index 801e556e0..0057dfb82 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -158,14 +158,13 @@ function translation_form_alter(&$form, $form_state, $form_id) { } /** - * Implementation of hook_link(). + * Implementation of hook_nodeapi_view(). * * Display translation links with native language names, if this node * is part of a translation set. */ -function translation_link($type, $node = NULL, $teaser = FALSE) { - $links = array(); - if ($type == 'node' && ($node->tnid) && $translations = translation_node_get_translations($node->tnid)) { +function translation_nodeapi_view(&$node, $teaser = FALSE) { + if (isset($node->tnid) && $translations = translation_node_get_translations($node->tnid)) { // Do not show link to the same node. unset($translations[$node->language]); $languages = language_list(); @@ -177,10 +176,13 @@ function translation_link($type, $node = NULL, $teaser = FALSE) { 'language' => $language, 'attributes' => array('title' => $translations[$langcode]->title, 'class' => 'translation-link') ); + $node->content['links']['translation'] = array( + '#type' => 'node_links', + '#value' => $links, + ); } } } - return $links; } /** |