translation_node_get_translations

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 translation_node_get_translations($tnid)

Get all nodes in a translation set, represented by $tnid.

Übergabeparameter

$tnid The translation source nid of the translation set, the identifier of the node used to derive all translations in the set.

Rückgabewert

Array of partial node objects (nid, title, language) representing all nodes in the translation set, in effect all translations of node $tnid, including node $tnid itself. Because these are partial nodes, you need to node_load() the full node, if you need more properties. The array is indexed by language code.

▾ 5 functions call translation_node_get_translations()

translation_form_alter in modules/translation/translation.module
Implementation of hook_form_alter().
translation_link in modules/translation/translation.module
Implementation of hook_link().
translation_node_overview in modules/translation/translation.pages.inc
Overview page for a node's translations.
translation_path_get_translations in modules/translation/translation.module
Return paths of all translations of a node, based on its Drupal path.
translation_translation_link_alter in modules/translation/translation.module
Implementation of hook_translation_link_alter().

Code

modules/translation/translation.module, line 287

<?php
function translation_node_get_translations($tnid) {
  static $translations = array();

  if (is_numeric($tnid) && $tnid) {
    if (!isset($translations[$tnid])) {
      $translations[$tnid] = array();
      $result = db_query(db_rewrite_sql('SELECT n.nid, n.type, n.uid, n.status, n.title, n.language FROM {node} n WHERE n.tnid = %d'), $tnid);
      while ($node = db_fetch_object($result)) {
        $translations[$tnid][$node->language] = $node;
      }
    }
    return $translations[$tnid];
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen