You are here

function globallink_interface_get_xml in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.6 globallink_interface/globallink_interface.inc \globallink_interface_get_xml()

Gets XML data from specific interface.

Parameters

string $lid: The interface LID.

array $source_arr: The source array.

Return value

array Associative array of block XML data.

1 call to globallink_interface_get_xml()
globallink_interface_send_for_translations in globallink_interface/globallink_interface.inc
Sends interfaces for translation.

File

globallink_interface/globallink_interface.inc, line 85

Code

function globallink_interface_get_xml($lid, $source_arr) {
  $dom = new DOMDocument('1.0', 'UTF-8');
  $dom->formatOutput = TRUE;
  $root = $dom
    ->createElement('content');
  $dom
    ->appendChild($root);
  $id = $dom
    ->createAttribute('lid');
  $id->value = $lid;
  $root
    ->appendChild($id);
  globallink_insert_child_element($dom, $root, GLOBALLINK_ENTITY_TYPE_INTERFACE, $source_arr['source'], array(
    'name' => 'source',
    'lid' => $lid,
    'location' => $source_arr['location'],
  ));
  $xml = $dom
    ->saveXML();
  return $xml;
}