31 'renderType' =>
'tcaDescription',
39 'localizationStateSelector' => [
40 'renderType' =>
'localizationStateSelector',
76 $parameterArray = $this->data[
'parameterArray'];
77 $formElementId = md5($parameterArray[
'itemFormElName']);
80 $config = $parameterArray[
'fieldConf'][
'config'];
81 $readOnly = !empty($config[
'readOnly']) ?
'true' :
'false';
82 $exclusiveKeys = !empty($config[
'exclusiveKeys']) ? $config[
'exclusiveKeys'] :
'';
83 $exclusiveKeys = $exclusiveKeys .
',';
84 $appearance = !empty($config[
'treeConfig'][
'appearance']) ? $config[
'treeConfig'][
'appearance'] : [];
85 $expanded = !empty($appearance[
'expandAll']);
86 $showHeader = !empty($appearance[
'showHeader']);
87 if (isset($config[
'size']) && (
int)$config[
'size'] > 0) {
88 $height = max($this->minItemsToShow, (
int)$config[
'size']);
93 $treeWrapperId =
'tree_' . $formElementId;
95 $fieldName = $this->data[
'fieldName'];
97 $dataStructureIdentifier =
'';
98 $flexFormSheetName =
'';
99 $flexFormFieldName =
'';
100 $flexFormContainerName =
'';
101 $flexFormContainerIdentifier =
'';
102 $flexFormContainerFieldName =
'';
103 $flexFormSectionContainerIsNew =
false;
104 if ($this->data[
'processedTca'][
'columns'][$fieldName][
'config'][
'type'] ===
'flex') {
105 $dataStructureIdentifier = $this->data[
'processedTca'][
'columns'][$fieldName][
'config'][
'dataStructureIdentifier'];
106 if (isset($this->data[
'flexFormSheetName'])) {
107 $flexFormSheetName = $this->data[
'flexFormSheetName'];
109 if (isset($this->data[
'flexFormFieldName'])) {
110 $flexFormFieldName = $this->data[
'flexFormFieldName'];
112 if (isset($this->data[
'flexFormContainerName'])) {
113 $flexFormContainerName = $this->data[
'flexFormContainerName'];
115 if (isset($this->data[
'flexFormContainerFieldName'])) {
116 $flexFormContainerFieldName = $this->data[
'flexFormContainerFieldName'];
118 if (isset($this->data[
'flexFormContainerIdentifier'])) {
119 $flexFormContainerIdentifier = $this->data[
'flexFormContainerIdentifier'];
123 if (!empty($this->data[
'flexSectionContainerPreparation'])) {
124 $flexFormSectionContainerIsNew =
true;
129 $fieldInformationHtml = $fieldInformationResult[
'html'];
133 $fieldWizardHtml = $fieldWizardResult[
'html'];
137 $html[] =
'<div class="formengine-field-item t3js-formengine-field-item">';
138 $html[] = $fieldInformationHtml;
139 $html[] =
'<div class="form-control-wrap">';
140 $html[] =
'<div class="form-wizards-wrap">';
141 $html[] =
'<div class="form-wizards-element">';
142 $html[] =
'<div class="typo3-tceforms-tree">';
143 $html[] =
'<input class="treeRecord" type="hidden"';
145 $html[] =
' data-relatedfieldname="' . htmlspecialchars($parameterArray[
'itemFormElName']) .
'"';
146 $html[] =
' data-tablename="' . htmlspecialchars($this->data[
'tableName']) .
'"';
147 $html[] =
' data-fieldname="' . htmlspecialchars($this->data[
'fieldName']) .
'"';
148 $html[] =
' data-uid="' . (int)$this->data[
'vanillaUid'] .
'"';
149 $html[] =
' data-recordtypevalue="' . htmlspecialchars($this->data[
'recordTypeValue']) .
'"';
150 $html[] =
' data-datastructureidentifier="' . htmlspecialchars($dataStructureIdentifier) .
'"';
151 $html[] =
' data-flexformsheetname="' . htmlspecialchars($flexFormSheetName) .
'"';
152 $html[] =
' data-flexformfieldname="' . htmlspecialchars($flexFormFieldName) .
'"';
153 $html[] =
' data-flexformcontainername="' . htmlspecialchars($flexFormContainerName) .
'"';
154 $html[] =
' data-flexformcontaineridentifier="' . htmlspecialchars($flexFormContainerIdentifier) .
'"';
155 $html[] =
' data-flexformcontainerfieldname="' . htmlspecialchars($flexFormContainerFieldName) .
'"';
156 $html[] =
' data-flexformsectioncontainerisnew="' . htmlspecialchars($flexFormSectionContainerIsNew) .
'"';
157 $html[] =
' data-command="' . htmlspecialchars($this->data[
'command']) .
'"';
158 $html[] =
' data-read-only="' . $readOnly .
'"';
159 $html[] =
' data-tree-exclusive-keys="' . htmlspecialchars($exclusiveKeys) .
'"';
160 $html[] =
' data-tree-expand-up-to-level="' . ($expanded ?
'999' :
'1') .
'"';
161 $html[] =
' data-tree-show-toolbar="' . $showHeader .
'"';
162 $html[] =
' name="' . htmlspecialchars($parameterArray[
'itemFormElName']) .
'"';
163 $html[] =
' id="treeinput' . $formElementId .
'"';
164 $html[] =
' value="' . htmlspecialchars(implode(
',', $parameterArray[
'itemFormElValue'])) .
'"';
167 $html[] =
'<div id="' . $treeWrapperId .
'" class="svg-tree-wrapper" style="height: ' . $heightInPx .
'px;"></div>';
168 $html[] =
'<script type="text/javascript">var ' . $treeWrapperId .
' = ' . $this->
getTreeOnChangeJs() .
'</script>';
170 if ($readOnly ===
'false' && !empty($fieldWizardHtml)) {
171 $html[] =
'<div class="form-wizards-items-bottom">';
172 $html[] = $fieldWizardHtml;
179 $resultArray[
'html'] = implode(LF, $html);
183 $resultArray[
'additionalInlineLanguageLabelFiles'][] =
'EXT:core/Resources/Private/Language/locallang_csh_corebe.xlf';
185 $resultArray[
'requireJsModules'][
'selectTreeElement'] = [
186 'TYPO3/CMS/Backend/FormEngine/Element/SelectTreeElement' =>
'function (SelectTreeElement) { SelectTreeElement.initialize(); }'
199 $parameterArray = $this->data[
'parameterArray'];
200 $onChange = !empty($parameterArray[
'fieldChangeFunc'][
'TBE_EDITOR_fieldChanged']) ? $parameterArray[
'fieldChangeFunc'][
'TBE_EDITOR_fieldChanged'] :
'';
201 $onChange .= !empty($parameterArray[
'fieldChangeFunc'][
'alert']) ? $parameterArray[
'fieldChangeFunc'][
'alert'] :
'';
202 return 'function () {' . $onChange .
'}';