Mercurial > defr > drupal > core
comparison modules/translation/translation.module @ 11:589fb7c02327 6.5
Drupal 6.5
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 23 Dec 2008 14:32:19 +0100 |
parents | c1f4ac30525a |
children | 8b6c45761e01 |
comparison
equal
deleted
inserted
replaced
10:6f15c9d74937 | 11:589fb7c02327 |
---|---|
1 <?php | 1 <?php |
2 // $Id: translation.module,v 1.23 2008/01/28 11:38:58 goba Exp $ | 2 // $Id: translation.module,v 1.23.2.1 2008/08/16 21:37:45 dries Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * Manages content translations. | 6 * Manages content translations. |
7 * | 7 * |
163 $links = array(); | 163 $links = array(); |
164 if ($type == 'node' && ($node->tnid) && $translations = translation_node_get_translations($node->tnid)) { | 164 if ($type == 'node' && ($node->tnid) && $translations = translation_node_get_translations($node->tnid)) { |
165 // Do not show link to the same node. | 165 // Do not show link to the same node. |
166 unset($translations[$node->language]); | 166 unset($translations[$node->language]); |
167 $languages = language_list(); | 167 $languages = language_list(); |
168 foreach ($translations as $language => $translation) { | 168 foreach ($languages as $langcode => $language) { |
169 $links["node_translation_$language"] = array( | 169 if (isset($translations[$langcode])) { |
170 'title' => $languages[$language]->native, | 170 $links["node_translation_$langcode"] = array( |
171 'href' => "node/$translation->nid", | 171 'title' => $language->native, |
172 'language' => $languages[$language], | 172 'href' => 'node/'. $translations[$langcode]->nid, |
173 'attributes' => array('title' => $translation->title, 'class' => 'translation-link') | 173 'language' => $language, |
174 ); | 174 'attributes' => array('title' => $translations[$langcode]->title, 'class' => 'translation-link') |
175 ); | |
176 } | |
175 } | 177 } |
176 } | 178 } |
177 return $links; | 179 return $links; |
178 } | 180 } |
179 | 181 |