‪TYPO3CMS  10.4
TcaColumnsProcessCommon.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
25 {
35  public function ‪addData(array $result)
36  {
37  // enables the backend to display a visual comparison between a new version and its original
38  $tableProperties = $result['processedTca']['ctrl'];
39  if (!empty($tableProperties['origUid'])) {
40  $result['columnsToProcess'][] = $tableProperties['origUid'];
41  }
42 
43  // determines which one of the 'types' configurations are used for displaying the fields in the backend
44  if (!empty($tableProperties['type'])) {
45  // Allow for relation_field:foreign_type_field syntax
46  $fieldName = ‪GeneralUtility::trimExplode(':', $tableProperties['type'], true, 2);
47  $result['columnsToProcess'][] = $fieldName[0];
48  }
49 
50  // field that contains the language of the record
51  if (!empty($tableProperties['languageField'])) {
52  $result['columnsToProcess'][] = $tableProperties['languageField'];
53  }
54 
55  // field that contains the pointer to the original record
56  if (!empty($tableProperties['transOrigPointerField'])) {
57  $result['columnsToProcess'][] = $tableProperties['transOrigPointerField'];
58  }
59 
60  // field that contains the value of the original language record
61  if (!empty($tableProperties['transOrigDiffSourceField'])) {
62  $result['columnsToProcess'][] = $tableProperties['transOrigDiffSourceField'];
63  }
64 
65  // fields added to subtypes_addlist (can be pi_flexform)
66  $recordTypeValue = $result['recordTypeValue'];
67  if (!empty($result['processedTca']['types'][$recordTypeValue]['subtype_value_field'])) {
68  $subtypeFieldName = $result['processedTca']['types'][$recordTypeValue]['subtype_value_field'];
69  if (!empty($result['processedTca']['types'][$recordTypeValue]['subtypes_addlist'][$result['databaseRow'][$subtypeFieldName]])) {
71  ',',
72  $result['processedTca']['types'][$recordTypeValue]['subtypes_addlist'][$result['databaseRow'][$subtypeFieldName]],
73  true
74  );
75  foreach (‪$fields as $field) {
76  $result['columnsToProcess'][] = $field;
77  }
78  }
79  }
80 
81  return $result;
82  }
83 }
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessCommon
Definition: TcaColumnsProcessCommon.php:25
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessCommon\addData
‪array addData(array $result)
Definition: TcaColumnsProcessCommon.php:35
‪$fields
‪$fields
Definition: pages.php:5
‪TYPO3\CMS\Backend\Form\FormDataProvider
Definition: AbstractDatabaseRecordProvider.php:16
‪TYPO3\CMS\Backend\Form\FormDataProviderInterface
Definition: FormDataProviderInterface.php:23
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static string[] trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:1059
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46