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