protected function WebformConfigProcessor::convertTranslationToElements

Converts the special elements data structure back to elements.

Parameters

array $translation: The already converted data structure.

Return value

array The webform elements structure with specially escaped characters replaced.

1 call to WebformConfigProcessor::convertTranslationToElements()
WebformConfigProcessor::convertToTranslation in sources/tmgmt_config/src/WebformConfigProcessor.php
Converts a translated data structure.

File

sources/tmgmt_config/src/WebformConfigProcessor.php, line 115

Class

WebformConfigProcessor

Namespace

Drupal\tmgmt_config

Code

protected function convertTranslationToElements(array $translation) {
  $elements = [];
  foreach ($translation as $key => $value) {
    $safe_key = strtr($key, array_flip(self::REPLACE_PAIRS));
    if (is_array($value)) {
      $elements[$safe_key] = $this
        ->convertTranslationToElements($value);
    }
    else {
      $elements[$safe_key] = $value;
    }
  }
  return $elements;
}