You are here

function flag_node::get_translation_id in Flag 7.2

Same name and namespace in other branches
  1. 5 flag.inc \flag_node::get_translation_id()
  2. 6.2 flag.inc \flag_node::get_translation_id()
  3. 6 flag.inc \flag_node::get_translation_id()
  4. 7.3 includes/flag/flag_node.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::get_flagging_record in ./flag.inc

File

./flag.inc, line 1595
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;
}