You are here

function tmgmt_unflatten_data in Translation Management Tool 7

Converts a flattened data structure into a nested array.

This function can be used by translators to help with the data conversion.

Nested keys will be created based on the colon, so for example $flattened_data['key1][key2][key3'] will be converted into $data['key1']['key2']['key3'].

Parameters

$data: The flattened data array.

Return value

array The nested data array.

See also

tmgmt_flatten_data()

3 calls to tmgmt_unflatten_data()
TMGMTFileFormatHTML::import in translators/file/tmgmt_file.format.html.inc
Converts an exported file content back to the translated data.
TMGMTFileformatXLIFF::import in translators/file/tmgmt_file.format.xliff.inc
Converts an exported file content back to the translated data.
TMGMTTestTranslatorPluginController::requestTranslation in tests/tmgmt_test.plugin.translator.inc
@abstract

File

./tmgmt.module, line 1416
Main module file for the Translation Management module.

Code

function tmgmt_unflatten_data($flattened_data) {
  $data = array();
  foreach ($flattened_data as $key => $flattened_data_entry) {
    drupal_array_set_nested_value($data, explode(TMGMT_ARRAY_DELIMITER, $key), $flattened_data_entry);
  }
  return $data;
}