35 'renderType' =>
'tcaDescription',
45 'localizationStateSelector' => [
46 'renderType' =>
'localizationStateSelector',
48 'otherLanguageContent' => [
49 'renderType' =>
'otherLanguageContent',
51 'localizationStateSelector'
54 'defaultLanguageDifferences' => [
55 'renderType' =>
'defaultLanguageDifferences',
57 'otherLanguageContent',
80 $table = $this->data[
'tableName'];
81 $fieldName = $this->data[
'fieldName'];
82 $row = $this->data[
'databaseRow'];
83 $parameterArray = $this->data[
'parameterArray'];
86 $itemValue = $parameterArray[
'itemFormElValue'];
87 $config = $parameterArray[
'fieldConf'][
'config'];
88 $evalList = GeneralUtility::trimExplode(
',', $config[
'eval'],
true);
91 $nullControlNameEscaped = htmlspecialchars(
'control[active][' . $table .
'][' . $row[
'uid'] .
'][' . $fieldName .
']');
95 $originalRows = $rows;
96 $itemFormElementValueLength = strlen($itemValue);
97 if ($itemFormElementValueLength > $this->charactersPerRow * 2) {
99 round($itemFormElementValueLength / $this->charactersPerRow),
100 count(explode(LF, $itemValue)),
103 if ($rows < $originalRows) {
104 $rows = $originalRows;
109 $fieldInformationHtml = $fieldInformationResult[
'html'];
112 if ($config[
'readOnly']) {
114 $html[] =
'<div class="formengine-field-item t3js-formengine-field-item">';
115 $html[] = $fieldInformationHtml;
116 $html[] =
'<div class="form-wizards-wrap">';
117 $html[] =
'<div class="form-wizards-element">';
118 $html[] =
'<div class="form-control-wrap" style="max-width: ' . $width .
'px">';
119 $html[] =
'<textarea class="form-control" rows="' . $rows .
'" disabled>';
120 $html[] = htmlspecialchars($itemValue);
121 $html[] =
'</textarea>';
126 $resultArray[
'html'] = implode(LF, $html);
131 foreach ($evalList as $func) {
136 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tce'][
'formevals'][$func])) {
137 if (class_exists($func)) {
138 $evalObj = GeneralUtility::makeInstance($func);
139 if (method_exists($evalObj,
'deevaluateFieldValue')) {
141 'value' => $itemValue
143 $itemValue = $evalObj->deevaluateFieldValue($_params);
151 'name' => htmlspecialchars($parameterArray[
'itemFormElName']),
153 'data-formengine-input-name' => htmlspecialchars($parameterArray[
'itemFormElName']),
155 'wrap' => $config[
'wrap'] ?:
'virtual',
156 'onChange' => implode(
'', $parameterArray[
'fieldChangeFunc']),
160 't3js-formengine-textarea',
161 'formengine-textarea',
163 if ($config[
'fixedFont']) {
164 $classes[] =
'text-monospace';
166 if ($config[
'enableTabulator']) {
167 $classes[] =
't3js-enable-tab';
169 $attributes[
'class'] = implode(
' ', $classes);
170 $maximumHeight = (int)$backendUser->uc[
'resizeTextareas_MaxHeight'];
171 if ($maximumHeight > 0) {
173 $attributes[
'style'] =
'max-height: ' . $maximumHeight .
'px';
175 if (isset($config[
'max']) && (int)$config[
'max'] > 0) {
176 $attributes[
'maxlength'] = (int)$config[
'max'];
178 if (!empty($config[
'placeholder'])) {
179 $attributes[
'placeholder'] = htmlspecialchars(trim($config[
'placeholder']));
182 $valuePickerHtml = [];
183 if (isset($config[
'valuePicker'][
'items']) && is_array($config[
'valuePicker'][
'items'])) {
184 $mode = $config[
'valuePicker'][
'mode'] ??
'';
185 $itemName = $parameterArray[
'itemFormElName'];
186 $fieldChangeFunc = $parameterArray[
'fieldChangeFunc'];
187 if ($mode ===
'append') {
188 $assignValue =
'document.querySelectorAll(' . GeneralUtility::quoteJSvalue(
'[data-formengine-input-name="' . $itemName .
'"]') .
')[0]'
189 .
'.value=\'\'+this.options[this.selectedIndex].value+document.editform[' . GeneralUtility::quoteJSvalue($itemName) .
'].value';
190 } elseif ($mode ===
'prepend') {
191 $assignValue =
'document.querySelectorAll(' . GeneralUtility::quoteJSvalue(
'[data-formengine-input-name="' . $itemName .
'"]') .
')[0]'
192 .
'.value+=\'\'+this.options[this.selectedIndex].value';
194 $assignValue =
'document.querySelectorAll(' . GeneralUtility::quoteJSvalue(
'[data-formengine-input-name="' . $itemName .
'"]') .
')[0]'
195 .
'.value=this.options[this.selectedIndex].value';
197 $valuePickerHtml[] =
'<select';
198 $valuePickerHtml[] =
' class="form-control tceforms-select tceforms-wizardselect"';
199 $valuePickerHtml[] =
' onchange="' . htmlspecialchars($assignValue .
';this.blur();this.selectedIndex=0;' . implode(
'', $fieldChangeFunc)) .
'"';
200 $valuePickerHtml[] =
'>';
201 $valuePickerHtml[] =
'<option></option>';
202 foreach ($config[
'valuePicker'][
'items'] as $item) {
203 $valuePickerHtml[] =
'<option value="' . htmlspecialchars($item[1]) .
'">' . htmlspecialchars($languageService->sL($item[0])) .
'</option>';
205 $valuePickerHtml[] =
'</select>';
209 $fieldControlHtml = $fieldControlResult[
'html'];
213 $fieldWizardHtml = $fieldWizardResult[
'html'];
217 $mainFieldHtml[] =
'<div class="form-control-wrap" style="max-width: ' . $width .
'px">';
218 $mainFieldHtml[] =
'<div class="form-wizards-wrap">';
219 $mainFieldHtml[] =
'<div class="form-wizards-element">';
220 $mainFieldHtml[] =
'<textarea ' . GeneralUtility::implodeAttributes($attributes,
true) .
'>' . htmlspecialchars($itemValue) .
'</textarea>';
221 $mainFieldHtml[] =
'</div>';
222 if (!empty($valuePickerHtml) || !empty($fieldControlHtml)) {
223 $mainFieldHtml[] =
'<div class="form-wizards-items-aside">';
224 $mainFieldHtml[] =
'<div class="btn-group">';
225 $mainFieldHtml[] = implode(LF, $valuePickerHtml);
226 $mainFieldHtml[] = $fieldControlHtml;
227 $mainFieldHtml[] =
'</div>';
228 $mainFieldHtml[] =
'</div>';
230 if (!empty($fieldWizardHtml)) {
231 $mainFieldHtml[] =
'<div class="form-wizards-items-bottom">';
232 $mainFieldHtml[] = $fieldWizardHtml;
233 $mainFieldHtml[] =
'</div>';
235 $mainFieldHtml[] =
'</div>';
236 $mainFieldHtml[] =
'</div>';
237 $mainFieldHtml = implode(LF, $mainFieldHtml);
239 $fullElement = $mainFieldHtml;
241 $checked = $itemValue !==
null ?
' checked="checked"' :
'';
243 $fullElement[] =
'<div class="t3-form-field-disable"></div>';
244 $fullElement[] =
'<div class="checkbox t3-form-field-eval-null-checkbox">';
245 $fullElement[] =
'<label for="' . $nullControlNameEscaped .
'">';
246 $fullElement[] =
'<input type="hidden" name="' . $nullControlNameEscaped .
'" value="0" />';
247 $fullElement[] =
'<input type="checkbox" name="' . $nullControlNameEscaped .
'" id="' . $nullControlNameEscaped .
'" value="1"' . $checked .
' />';
248 $fullElement[] = $languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.nullCheckbox');
249 $fullElement[] =
'</label>';
250 $fullElement[] =
'</div>';
251 $fullElement[] = $mainFieldHtml;
252 $fullElement = implode(LF, $fullElement);
254 $checked = $itemValue !==
null ?
' checked="checked"' :
'';
255 $placeholder = $shortenedPlaceholder = $config[
'placeholder'] ??
'';
258 if (strlen($placeholder) > 0) {
259 $shortenedPlaceholder = GeneralUtility::fixed_lgd_cs($placeholder, 20);
260 if ($placeholder !== $shortenedPlaceholder) {
261 $overrideLabel = sprintf(
262 $languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'),
263 '<span title="' . htmlspecialchars($placeholder) .
'">' . htmlspecialchars($shortenedPlaceholder) .
'</span>'
266 $overrideLabel = sprintf(
267 $languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'),
268 htmlspecialchars($placeholder)
272 $overrideLabel = $languageService->sL(
273 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
277 $fullElement[] =
'<div class="checkbox t3js-form-field-eval-null-placeholder-checkbox">';
278 $fullElement[] =
'<label for="' . $nullControlNameEscaped .
'">';
279 $fullElement[] =
'<input type="hidden" name="' . $nullControlNameEscaped .
'" value="' . $fallbackValue .
'" />';
280 $fullElement[] =
'<input type="checkbox" name="' . $nullControlNameEscaped .
'" id="' . $nullControlNameEscaped .
'" value="1"' . $checked . $disabled .
' />';
281 $fullElement[] = $overrideLabel;
282 $fullElement[] =
'</label>';
283 $fullElement[] =
'</div>';
284 $fullElement[] =
'<div class="t3js-formengine-placeholder-placeholder">';
285 $fullElement[] =
'<div class="form-control-wrap" style="max-width:' . $width .
'px">';
286 $fullElement[] =
'<textarea';
287 $fullElement[] =
' class="form-control formengine-textarea' . (isset($config[
'fixedFont']) ?
' text-monospace' :
'') .
'"';
288 $fullElement[] =
' disabled="disabled"';
289 $fullElement[] =
' rows="' . htmlspecialchars($attributes[
'rows']) .
'"';
290 $fullElement[] =
' wrap="' . htmlspecialchars($attributes[
'wrap']) .
'"';
291 $fullElement[] = isset($attributes[
'style']) ?
' style="' . htmlspecialchars($attributes[
'style']) .
'"' :
'';
292 $fullElement[] = isset($attributes[
'maxlength']) ?
' maxlength="' . htmlspecialchars($attributes[
'maxlength']) .
'"' :
'';
293 $fullElement[] =
'>';
294 $fullElement[] = htmlspecialchars($shortenedPlaceholder);
295 $fullElement[] =
'</textarea>';
296 $fullElement[] =
'</div>';
297 $fullElement[] =
'</div>';
298 $fullElement[] =
'<div class="t3js-formengine-placeholder-formfield">';
299 $fullElement[] = $mainFieldHtml;
300 $fullElement[] =
'</div>';
301 $fullElement = implode(LF, $fullElement);
304 $resultArray[
'html'] =
'<div class="formengine-field-item t3js-formengine-field-item">' . $fieldInformationHtml . $fullElement .
'</div>';