You are here

function _tmgmt_local_translated_data_7001 in Translation Management Tool 7

Data parsing helper function for tmgmt_local_update_7001().

Copies #translation texts from the source data array to the translation data array.

Parameters

array $source: The original source data array of the job item.

Return value

array The filled translation data array.

1 call to _tmgmt_local_translated_data_7001()
tmgmt_local_update_7001 in translators/tmgmt_local/tmgmt_local.install
Create local task items.

File

translators/tmgmt_local/tmgmt_local.install, line 324
Installation hooks for tmgmt_local module.

Code

function _tmgmt_local_translated_data_7001($source) {
  if (!empty($source['#translation']['#text'])) {
    $translation['#text'] = $source['#translation']['#text'];
    if (!empty($source['#status'])) {
      $translation['#status'] = $source['#status'];
    }
    return $translation;
  }
  else {
    $translation = array();
    foreach (element_children($source) as $key) {
      if ($return = _tmgmt_local_translated_data_7001($source[$key])) {
        $translation[$key] = $return;
      }
    }
    if (!empty($translation)) {
      return $translation;
    }
  }
}