TYPO3  7.6
SoloFieldContainer.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Backend\Form\Container;
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 
30 {
36  public function render()
37  {
38  $table = $this->data['tableName'];
39  $fieldToRender = $this->data['singleFieldToRender'];
40  $recordTypeValue = $this->data['recordTypeValue'];
41  $resultArray = $this->initializeResultArray();
42 
43  // Load the description content for the table if requested
44  if ($GLOBALS['TCA'][$table]['interface']['always_description']) {
45  $languageService = $this->getLanguageService();
46  $languageService->loadSingleTableDescription($table);
47  }
48 
49  $itemList = $this->data['processedTca']['types'][$recordTypeValue]['showitem'];
50  $fields = GeneralUtility::trimExplode(',', $itemList, true);
51  foreach ($fields as $fieldString) {
52  $fieldConfiguration = $this->explodeSingleFieldShowItemConfiguration($fieldString);
53  $fieldName = $fieldConfiguration['fieldName'];
54  if ((string)$fieldName === (string)$fieldToRender) {
55  // Field is in showitem configuration
56  // @todo: This field is not rendered if it is "hidden" in a palette!
57  if ($GLOBALS['TCA'][$table]['columns'][$fieldName]) {
58  $options = $this->data;
59  $options['fieldName'] = $fieldName;
60  $options['renderType'] = 'singleFieldContainer';
61  $resultArray = $this->nodeFactory->create($options)->render();
62  }
63  }
64  }
65 
66  return $resultArray;
67  }
68 
72  protected function getLanguageService()
73  {
74  return $GLOBALS['LANG'];
75  }
76 }