protected function getViewVariables(array $row)
{
$extensionKey = $this->getExtensionKey($row);
$fieldName = $this->getFieldName($row);
$variables = array('record' => $row, 'settings' => $this->configurationService->getSettingsForExtensionName($extensionKey));
// Special case: when saving a new record variable $row[$fieldName] is already an array
// and must not be processed by the configuration service. This has limited support from
// Flux (essentially: no Form instance which means no inheritance, transformation or
// form options can be dependended upon at this stage).
$lang = $this->getCurrentLanguageName();
$value = $this->getCurrentValuePointerName();
if (FALSE === is_array($row[$fieldName])) {
$recordVariables = $this->configurationService->convertFlexFormContentToArray($row[$fieldName], NULL, $lang, $value);
$variables = RecursiveArrayUtility::mergeRecursiveOverrule($variables, $recordVariables);
}
$variables = RecursiveArrayUtility::mergeRecursiveOverrule($this->templateVariables, $variables);
return $variables;
}