You are here

function flag_node::get_translation_id in Flag 5

Same name and namespace in other branches
  1. 6.2 flag.inc \flag_node::get_translation_id()
  2. 6 flag.inc \flag_node::get_translation_id()
  3. 7.3 includes/flag/flag_node.inc \flag_node::get_translation_id()
  4. 7.2 flag.inc \flag_node::get_translation_id()

Adjust the Content ID to find the translation parent if i18n-enabled.

Parameters

$content_id: The nid for the content.

Return value

The tnid if available, the nid otherwise.

2 calls to flag_node::get_translation_id()
flag_node::flag in ./flag.inc
flag_node::is_flagged in ./flag.inc

File

./flag.inc, line 875
Implements various flags. Uses object oriented style inspired by that of Views 2.

Class

flag_node
Implements a node flag.

Code

function get_translation_id($content_id) {
  if ($this->i18n) {
    $node = $this
      ->fetch_content($content_id);
    if (!empty($node->tnid)) {
      $content_id = $node->tnid;
    }
  }
  return $content_id;
}