You are here

function globallink_interface_get_xml in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 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.

2 calls to globallink_interface_get_xml()
globallink_interface_get_translations_for_row_id in globallink_interface/globallink_interface_receive.inc
Gets interface translations by row ID.
globallink_interface_send_for_translations in globallink_interface/globallink_interface.inc
Sends interfaces for translation.

File

globallink_interface/globallink_interface.inc, line 84

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, 'interface', $source_arr['source'], array(
    'name' => 'source',
    'lid' => $lid,
    'location' => $source_arr['location'],
  ));
  $xml = $dom
    ->saveXML();
  return $xml;
}