You are here

function globallink_get_xml in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink_node.inc \globallink_get_xml()
  2. 7.6 globallink_node.inc \globallink_get_xml()

Retrieves translation XML data.

Parameters

object $node: The node data.

string $target_arr: Array of locales node is being translated into.

int $tnid: The node id for existing translations. Defaults to null.

int $tvid: The node vid for existing translations. Defaults to null.

string $name: The xml document name. Defaults to empty string.

bool $for_display: Indicate for display purposes only. Defaults to false.

Return value

string The node deleted status or the translation XML data.

1 call to globallink_get_xml()
globallink_send_for_translations in ./globallink_node.inc

File

./globallink_node.inc, line 1141

Code

function globallink_get_xml($node, $target_arr, $tnid = NULL, $tvid = NULL, &$name = '', $for_display = FALSE) {
  if (is_null($node)) {
    return GLOBALLINK_STATUS_TRANSLATION_SOURCE_DELETED;
  }
  elseif (!$node) {
    return GLOBALLINK_STATUS_TRANSLATION_SOURCE_DELETED;
  }
  if ($node && is_object($node)) {
    if ($node->language != 'en') {
      $name = 'Node_' . $node->nid . '_Non_English' . $name;
    }
    else {
      $name = globallink_format_file_name($node->title) . '_' . $node->nid . $name;
    }
    $xml = globallink_generate_xml_document($node, $target_arr, $tnid, $tvid, $for_display);
    return $xml;
  }
  return GLOBALLINK_STATUS_TRANSLATION_SOURCE_DELETED;
}