diff 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
line wrap: on
line diff
--- a/modules/translation/translation.module	Tue Dec 23 14:32:08 2008 +0100
+++ b/modules/translation/translation.module	Tue Dec 23 14:32:19 2008 +0100
@@ -1,5 +1,5 @@
 <?php
-// $Id: translation.module,v 1.23 2008/01/28 11:38:58 goba Exp $
+// $Id: translation.module,v 1.23.2.1 2008/08/16 21:37:45 dries Exp $
 
 /**
  * @file
@@ -165,13 +165,15 @@
     // Do not show link to the same node.
     unset($translations[$node->language]);
     $languages = language_list();
-    foreach ($translations as $language => $translation) {
-      $links["node_translation_$language"] = array(
-        'title' => $languages[$language]->native,
-        'href' => "node/$translation->nid",
-        'language' => $languages[$language],
-        'attributes' => array('title' => $translation->title, 'class' => 'translation-link')
-      );
+    foreach ($languages as $langcode => $language) {
+      if (isset($translations[$langcode])) {
+        $links["node_translation_$langcode"] = array(
+          'title' => $language->native,
+          'href' => 'node/'. $translations[$langcode]->nid,
+          'language' => $language,
+          'attributes' => array('title' => $translations[$langcode]->title, 'class' => 'translation-link')
+        );
+      }
     }
   }
   return $links;