2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
35 $table = $result[
'tableName'];
37 foreach ($result[
'processedTca'][
'columns'] as $fieldName => $fieldConfig) {
38 if (empty($fieldConfig[
'config'][
'type']) || $fieldConfig[
'config'][
'type'] !==
'check') {
42 if (!is_array($fieldConfig[
'config'][
'items'])) {
43 $fieldConfig[
'config'][
'items'] = array();
46 $config = $fieldConfig[
'config'];
47 $items = $config[
'items'];
51 foreach ($items as $itemKey => $itemValue) {
52 if (!is_array($itemValue)) {
53 throw new \UnexpectedValueException(
54 'Item ' . $itemKey .
' of field ' . $fieldName .
' of TCA table ' . $result[
'tableName'] .
' is no array as exepcted',
58 if (!array_key_exists(0, $itemValue)) {
59 throw new \UnexpectedValueException(
60 'Item ' . $itemKey .
' of field ' . $fieldName .
' of TCA table ' . $result[
'tableName'] .
' has no label',
64 if (!array_key_exists(1, $itemValue)) {
67 $newItems[$itemKey] = [
68 $languageService->sL(trim($itemValue[0])),
75 if (!empty($config[
'itemsProcFunc'])) {
76 $items = $this->resolveItemProcessorFunction($result, $fieldName, $items);
78 unset($result[
'processedTca'][
'columns'][$fieldName][
'config'][
'itemsProcFunc']);
82 if (isset($result[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'][
'altLabels.'])
83 && is_array($result[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'][
'altLabels.'])
85 foreach ($result[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'][
'altLabels.'] as $itemKey => $label) {
86 if (isset($items[$itemKey][0])) {
87 $items[$itemKey][0] = $languageService->sL($label);
92 $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'items'] = $items;