2 namespace TYPO3\CMS\Backend\Form\Element;
45 $table = $this->data[
'tableName'];
46 $fieldName = $this->data[
'fieldName'];
47 $row = $this->data[
'databaseRow'];
48 $parameterArray = $this->data[
'parameterArray'];
52 $config = $parameterArray[
'fieldConf'][
'config'];
59 $originalRows = $rows;
61 $itemFormElementValueLength = strlen($parameterArray[
'itemFormElValue']);
62 if ($itemFormElementValueLength > $this->charactersPerRow * 2) {
65 round($itemFormElementValueLength / $this->charactersPerRow),
66 count(explode(LF, $parameterArray[
'itemFormElValue'])),
69 if ($rows < $originalRows) {
70 $rows = $originalRows;
77 if ($config[
'readOnly']) {
78 $config[
'cols'] = $cols;
79 $config[
'rows'] = $rows;
81 $options[
'parameterArray'] = array(
85 'itemFormElValue' => $parameterArray[
'itemFormElValue'],
87 $options[
'renderType'] =
'none';
88 return $this->nodeFactory->create($options)->render();
97 if ($specialConfiguration[
'rte_only']) {
98 $html =
'<p><em>' . htmlspecialchars($this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.noRTEfound')) .
'</em></p>';
100 $attributes = array();
102 foreach ($evalList as $func) {
103 if ($func ===
'required') {
110 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tce'][
'formevals'][$func])) {
111 if (class_exists($func)) {
113 if (method_exists($evalObj,
'deevaluateFieldValue')) {
115 'value' => $parameterArray[
'itemFormElValue']
117 $parameterArray[
'itemFormElValue'] = $evalObj->deevaluateFieldValue($_params);
126 $classes[] =
'form-control';
127 $classes[] =
't3js-formengine-textarea';
128 $classes[] =
'formengine-textarea';
129 if ($specialConfiguration[
'fixed-font']) {
130 $classes[] =
'text-monospace';
132 if ($specialConfiguration[
'enable-tab']) {
133 $classes[] =
't3js-enable-tab';
139 $maximumHeight = (int)$backendUser->uc[
'resizeTextareas_MaxHeight'];
140 if ($maximumHeight > 0) {
141 $styles[] =
'max-height: ' . $maximumHeight .
'px';
146 $attributes[
'name'] = $parameterArray[
'itemFormElName'];
147 if (!empty($styles)) {
148 $attributes[
'style'] = implode(
' ', $styles);
150 if (!empty($classes)) {
151 $attributes[
'class'] = implode(
' ', $classes);
153 $attributes[
'rows'] = $rows;
154 $attributes[
'wrap'] = $specialConfiguration[
'nowrap'] ?
'off' : ($config[
'wrap'] ?:
'virtual');
155 $attributes[
'onChange'] = implode(
'', $parameterArray[
'fieldChangeFunc']);
156 if (isset($config[
'max']) && (
int)$config[
'max'] > 0) {
157 $attributes[
'maxlength'] = (int)$config[
'max'];
159 $attributeString =
'';
160 foreach ($attributes as $attributeName => $attributeValue) {
161 $attributeString .=
' ' . $attributeName .
'="' . htmlspecialchars($attributeValue) .
'"';
165 $placeholderAttribute =
'';
166 if (!empty($config[
'placeholder'])) {
167 $placeholderAttribute =
' placeholder="' . htmlspecialchars(trim($config[
'placeholder'])) .
'" ';
172 . $placeholderAttribute
173 . $parameterArray[
'onFocus']
174 .
'>' . htmlspecialchars($parameterArray[
'itemFormElValue']) .
'</textarea>';
177 $html = $this->renderWizards(
184 $parameterArray[
'itemFormElName'],
185 $specialConfiguration,
190 $html =
'<div class="form-control-wrap"' . ($maximumWidth ?
' style="max-width: ' . $maximumWidth .
'px"' :
'') .
'>' . $html .
'</div>';
193 $resultArray[
'html'] = $html;