TYPO3 CMS  TYPO3_8-7
SoloFieldContainer.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 
30 {
37  public function render()
38  {
40  $table = $this->data['tableName'];
41  $fieldToRender = $this->data['singleFieldToRender'];
42  $recordTypeValue = $this->data['recordTypeValue'];
43  $resultArray = $this->initializeResultArray();
44 
45  // Load the description content for the table if requested
46  if ($GLOBALS['TCA'][$table]['interface']['always_description']) {
47  $languageService = $this->getLanguageService();
48  $languageService->loadSingleTableDescription($table);
49  }
50 
51  $itemList = $this->data['processedTca']['types'][$recordTypeValue]['showitem'];
52  $fields = GeneralUtility::trimExplode(',', $itemList, true);
53  foreach ($fields as $fieldString) {
54  $fieldConfiguration = $this->explodeSingleFieldShowItemConfiguration($fieldString);
55  $fieldName = $fieldConfiguration['fieldName'];
56  if ((string)$fieldName === (string)$fieldToRender) {
57  // Field is in showitem configuration
58  // @todo: This field is not rendered if it is "hidden" in a palette!
59  if ($GLOBALS['TCA'][$table]['columns'][$fieldName]) {
60  $options = $this->data;
61  $options['fieldName'] = $fieldName;
62  $options['renderType'] = 'singleFieldContainer';
63  $resultArray = $this->nodeFactory->create($options)->render();
64  }
65  }
66  }
67 
68  return $resultArray;
69  }
70 
74  protected function getLanguageService()
75  {
76  return $GLOBALS['LANG'];
77  }
78 }
static trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
$fields
Definition: pages.php:4
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']