TYPO3 CMS  TYPO3_8-7
NoneElement.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 
18 
23 {
29  public function render()
30  {
31  $resultArray = $this->initializeResultArray();
32 
33  $parameterArray = $this->data['parameterArray'];
34  $config = $parameterArray['fieldConf']['config'];
35  $itemValue = $parameterArray['itemFormElValue'];
36 
37  if (isset($config['format']) && $config['format']) {
38  $formatOptions = $config['format.'] ?? [];
39  $itemValue = $this->formatValue($config['format'], $itemValue, $formatOptions);
40  }
41  if (!$config['pass_content']) {
42  $itemValue = htmlspecialchars($itemValue);
43  }
44 
45  $cols = $config['cols'] ?: ($config['size'] ?: $this->defaultInputWidth);
46  $size = MathUtility::forceIntegerInRange($cols ?: $this->defaultInputWidth, 5, $this->maxInputWidth);
47  $width = $this->formMaxWidth($size);
48 
49  $fieldInformationResult = $this->renderFieldInformation();
50  $fieldInformationHtml = $fieldInformationResult['html'];
51  $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $fieldInformationResult, false);
52 
53  $html = [];
54  $html[] = '<div class="formengine-field-item t3js-formengine-field-item">';
55  $html[] = $fieldInformationHtml;
56  $html[] = '<div class="form-wizards-wrap">';
57  $html[] = '<div class="form-wizards-element">';
58  $html[] = '<div class="form-control-wrap" style="max-width: ' . $width . 'px">';
59  $html[] = '<input class="form-control" value="' . htmlspecialchars($itemValue) . '" type="text" disabled>';
60  $html[] = '</div>';
61  $html[] = '</div>';
62  $html[] = '</div>';
63  $html[] = '</div>';
64 
65  $resultArray['html'] = implode(LF, $html);
66 
67  return $resultArray;
68  }
69 }
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
Definition: MathUtility.php:31
mergeChildReturnIntoExistingResult(array $existing, array $childReturn, bool $mergeHtml=true)
formatValue($format, $itemValue, $formatOptions=[])