46 $table = $this->data[
'tableName'];
47 $row = $this->data[
'databaseRow'];
48 $fieldName = $this->data[
'fieldName'];
51 $parameterArray[
'fieldConf'] = $this->data[
'processedTca'][
'columns'][$fieldName];
57 if (isset($this->data[
'processedTca'][
'ctrl'][
'transOrigPointerField'])
58 && is_array($this->data[
'processedTca'][
'columns'][$this->data[
'processedTca'][
'ctrl'][
'transOrigPointerField']])
60 $parentValue = $row[$this->data[
'processedTca'][
'ctrl'][
'transOrigPointerField']];
62 $isOverlay = (bool)$parentValue;
63 } elseif (is_array($parentValue)) {
65 $isOverlay = !empty($parentValue) ? (bool)$parentValue[0] :
false;
67 throw new \InvalidArgumentException(
68 'The given value "' . $parentValue .
'" for the original language field ' . $this->data[
'processedTca'][
'ctrl'][
'transOrigPointerField']
69 .
' of table ' . $table .
' is invalid.',
78 $parameterArray[
'fieldConf'][
'exclude'] && !$backendUser->check(
'non_exclude_fields', $table .
':' . $fieldName)
80 || $isOverlay && empty($parameterArray[
'fieldConf'][
'l10n_display']) && $parameterArray[
'fieldConf'][
'l10n_mode'] ===
'exclude'
86 $parameterArray[
'fieldTSConfig'] = [];
87 if (isset($this->data[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'])
88 && is_array($this->data[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'])
90 $parameterArray[
'fieldTSConfig'] = $this->data[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'];
92 if ($parameterArray[
'fieldTSConfig'][
'disabled']) {
98 $parameterArray[
'itemFormElName'] =
'data[' . $table .
'][' . $row[
'uid'] .
'][' . $fieldName .
']';
99 $parameterArray[
'itemFormElID'] =
'data_' . $table .
'_' . $row[
'uid'] .
'_' . $fieldName;
100 $newElementBaseName = $this->data[
'elementBaseName'] .
'[' . $table .
'][' . $row[
'uid'] .
'][' . $fieldName .
']';
103 $parameterArray[
'itemFormElValue'] = $row[$fieldName];
105 if ($parameterArray[
'fieldConf'][
'l10n_display']
106 && GeneralUtility::inList($parameterArray[
'fieldConf'][
'l10n_display'],
'defaultAsReadonly')
109 $parameterArray[
'fieldConf'][
'config'][
'readOnly'] =
true;
110 $parameterArray[
'itemFormElValue'] = $this->data[
'defaultLanguageRow'][$fieldName];
113 if (strpos($this->data[
'processedTca'][
'ctrl'][
'type'],
':') ===
false) {
114 $typeField = $this->data[
'processedTca'][
'ctrl'][
'type'];
116 $typeField = substr($this->data[
'processedTca'][
'ctrl'][
'type'], 0, strpos($this->data[
'processedTca'][
'ctrl'][
'type'],
':'));
120 if (!empty($this->data[
'processedTca'][
'ctrl'][
'type']) && $fieldName === $typeField
121 || isset($parameterArray[
'fieldConf'][
'onChange']) && $parameterArray[
'fieldConf'][
'onChange'] ===
'reload'
124 $alertMsgOnChange =
'top.TYPO3.Modal.confirm('
125 .
'TYPO3.lang["FormEngine.refreshRequiredTitle"],'
126 .
' TYPO3.lang["FormEngine.refreshRequiredContent"]'
129 .
'"button.clicked",'
130 .
' function(e) { if (e.target.name == "ok" && TBE_EDITOR.checkSubmit(-1)) { TBE_EDITOR.submitForm() } top.TYPO3.Modal.dismiss(); }'
133 $alertMsgOnChange =
'if (TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
136 $alertMsgOnChange =
'';
140 $parameterArray[
'fieldChangeFunc'] = [];
141 $parameterArray[
'fieldChangeFunc'][
'TBE_EDITOR_fieldChanged'] =
'TBE_EDITOR.fieldChanged('
142 . GeneralUtility::quoteJSvalue($table) .
','
143 . GeneralUtility::quoteJSvalue($row[
'uid']) .
','
144 . GeneralUtility::quoteJSvalue($fieldName) .
','
145 . GeneralUtility::quoteJSvalue($parameterArray[
'itemFormElName'])
147 if ($alertMsgOnChange) {
148 $parameterArray[
'fieldChangeFunc'][
'alert'] = $alertMsgOnChange;
153 $inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
154 $inlineStackProcessor->initializeByGivenStructure($this->data[
'inlineStructure']);
155 $inlineDomObjectId = $inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($this->data[
'inlineFirstPid']);
156 $inlineObjectId = implode(
164 $parameterArray[
'fieldChangeFunc'][
'inline'] =
'inline.handleChangedField('
165 . GeneralUtility::quoteJSvalue($parameterArray[
'itemFormElName']) .
','
166 . GeneralUtility::quoteJSvalue($inlineObjectId)
172 $options[
'parameterArray'] = $parameterArray;
173 $options[
'elementBaseName'] = $newElementBaseName;
174 if (!empty($parameterArray[
'fieldConf'][
'config'][
'renderType'])) {
175 $options[
'renderType'] = $parameterArray[
'fieldConf'][
'config'][
'renderType'];
178 $options[
'renderType'] = $parameterArray[
'fieldConf'][
'config'][
'type'];
180 $resultArray = $this->nodeFactory->create($options)->render();
196 $inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
197 $inlineStackProcessor->initializeByGivenStructure($this->data[
'inlineStructure']);
198 $level = $inlineStackProcessor->getStructureLevel(-1);
199 if ($level[
'config'][
'foreign_label']) {
200 $label = $level[
'config'][
'foreign_label'];
202 $label = $this->data[
'processedTca'][
'ctrl'][
'label'];
204 return $level[
'config'][
'foreign_table'] === $table && $label === $field;
214 $table = $this->data[
'tableName'];
215 $fieldName = $this->data[
'fieldName'];
216 $fieldConfig = $this->data[
'processedTca'][
'columns'][$fieldName][
'config'];
219 $inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
220 $inlineStackProcessor->initializeByGivenStructure($this->data[
'inlineStructure']);
221 $structureDepth = $inlineStackProcessor->getStructureDepth();
223 $skipThisField =
false;
224 if ($structureDepth > 0) {
230 'foreign_table' => $table,
233 'appearance' => [
'useCombination' =>
true],
234 'foreign_selector' => $fieldName
236 'MM' => $fieldConfig[
'MM']
242 'foreign_table' => $fieldConfig[
'foreign_table'],
243 'foreign_selector' => $fieldConfig[
'foreign_field']
250 $level = $inlineStackProcessor->getStructureLevel(-1);
252 if ($this->data[
'isOnSymmetricSide']) {
253 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'symmetric_field'] = $fieldName;
254 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'symmetric_sortby'] = $fieldName;
256 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'foreign_field'] = $fieldName;
257 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'foreign_sortby'] = $fieldName;
261 return $skipThisField;
300 if (is_array($searchArray) && !empty($searchArray)) {
304 $type = key($searchArray);
305 $searchArray = current($searchArray);
308 $type = strtoupper($type);
310 foreach ($searchArray as $key => $value) {
313 if ($key ===
'%OR') {
315 } elseif ($key ===
'%AND') {
319 } elseif (is_array($value)) {
322 if (isset($subjectArray[$key]) && isset($value)) {
324 if (is_bool($value)) {
325 $localMatches += !($subjectArray[$key] xor $value) ? 1 : 0;
326 } elseif (is_numeric($subjectArray[$key]) && is_numeric($value)) {
327 $localMatches += $subjectArray[$key] == $value ? 1 : 0;
329 $localMatches += $subjectArray[$key] === $value ? 1 : 0;
334 if ($type ===
'%OR' && $localMatches > 0) {
338 if ($type ===
'%AND' && $localMatches == 0) {
344 return $localEntries === $localMatches;
355 return is_array($object) && !empty($object) && array_keys($object) !== range(0, count($object) - 1);