You are here

function _l10n_client_dom_strings in Localization client 5

Same name and namespace in other branches
  1. 6.2 l10n_client.module \_l10n_client_dom_strings()
  2. 6 l10n_client.module \_l10n_client_dom_strings()
  3. 7 l10n_client.module \_l10n_client_dom_strings()

Extended: The $strings array elements can now have a third 'lid' value

1 call to _l10n_client_dom_strings()
l10n_client_footer in ./l10n_client.module
Implementation of hook_footer().

File

./l10n_client.module, line 312
Localization client. Provides on-page translation editing.

Code

function _l10n_client_dom_strings($strings) {
  $output = '';
  foreach ($strings as $values) {
    $lid = $values[2];
    $source = $values[0] === TRUE ? '' : htmlspecialchars($values[0], ENT_NOQUOTES, 'UTF-8');
    $target = $values[1] === TRUE ? '' : htmlspecialchars($values[1], ENT_NOQUOTES, 'UTF-8');
    $output .= "<div><span class='lid'>{$lid}</span><span class='source'>{$source}</span><span class='target'>{$target}</span></div>";
  }
  return "<div id='l10n-client-data'>{$output}</div>";
}