You are here

function globallink_entity_get_xml in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink_entity/globallink_entity.inc \globallink_entity_get_xml()
  2. 7.5 globallink_entity/globallink_entity.inc \globallink_entity_get_xml()

Gets XML data from specific entity.

Parameters

object $node: The entity node.

array $target_arr: The target array

string $tnid: The translated entity node ID. Defaults to NULL.

string $tvid: The translated entity VID. Defaults to NULL.

string $name: The node name. Defaults to empty.

bool $for_display: Whether or not the XML will be displayed. Defaults to FALSE.

string $source_lang: The source language of the entity. Defaults to empty.

Return value

XML representation of the entity. 'Source Deleted' if the entity no longer exists.

2 calls to globallink_entity_get_xml()
globallink_entity_get_translations_for_row_id in globallink_entity/globallink_entity_receive.inc
Gets entity translations by row ID.
globallink_entity_send_for_translations in globallink_entity/globallink_entity.inc
Sends entities for translation.

File

globallink_entity/globallink_entity.inc, line 1371

Code

function globallink_entity_get_xml($node, $target_arr, $tnid = NULL, $tvid = NULL, &$name = '', $for_display = FALSE, $source_lang = '') {
  if (is_null($node)) {
    return 'Source Deleted';
  }
  elseif (!$node) {
    return '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) . $name;
    }
    $xml = globallink_entity_generate_xml_document($node, $target_arr, $tnid, $tvid, $for_display, $source_lang);
    return $xml;
  }
  return 'Source Deleted';
}