34 'renderType' =>
'tcaDescription',
44 'localizationStateSelector' => [
45 'renderType' =>
'localizationStateSelector',
47 'otherLanguageContent' => [
48 'renderType' =>
'otherLanguageContent',
50 'localizationStateSelector'
53 'defaultLanguageDifferences' => [
54 'renderType' =>
'defaultLanguageDifferences',
56 'otherLanguageContent',
70 $table = $this->data[
'tableName'];
71 $fieldName = $this->data[
'fieldName'];
72 $row = $this->data[
'databaseRow'];
73 $parameterArray = $this->data[
'parameterArray'];
76 $itemValue = $parameterArray[
'itemFormElValue'];
77 $config = $parameterArray[
'fieldConf'][
'config'];
79 $evalList = GeneralUtility::trimExplode(
',', $config[
'eval'],
true);
81 $nullControlNameEscaped = htmlspecialchars(
'control[active][' . $table .
'][' . $row[
'uid'] .
'][' . $fieldName .
']');
84 $fieldInformationHtml = $fieldInformationResult[
'html'];
87 if ($config[
'readOnly']) {
89 $html[] =
'<div class="formengine-field-item t3js-formengine-field-item">';
90 $html[] = $fieldInformationHtml;
91 $html[] =
'<div class="form-wizards-wrap">';
92 $html[] =
'<div class="form-wizards-element">';
93 $html[] =
'<div class="form-control-wrap" style="max-width: ' . $width .
'px">';
94 $html[] =
'<input class="form-control" value="' . htmlspecialchars($itemValue) .
'" type="text" disabled>';
99 $resultArray[
'html'] = implode(LF, $html);
104 foreach ($evalList as $func) {
108 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tce'][
'formevals'][$func])) {
109 if (class_exists($func)) {
110 $evalObj = GeneralUtility::makeInstance($func);
111 if (method_exists($evalObj,
'deevaluateFieldValue')) {
113 'value' => $itemValue
115 $itemValue = $evalObj->deevaluateFieldValue($_params);
117 if (method_exists($evalObj,
'returnFieldJS')) {
118 $resultArray[
'additionalJavaScriptPost'][] =
'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($evalData) .
'] = function(value) {' . $evalObj->returnFieldJS() .
'};';
125 $resultArray[
'requireJsModules'][] = [
126 'TYPO3/CMS/Backend/ColorPicker' =>
'function(ColorPicker){ColorPicker.initialize()}'
130 'value' => $itemValue,
132 'class' => implode(
' ', [
137 'formengine-colorpickerelement',
140 'data-formengine-input-params' => json_encode([
141 'field' => $parameterArray[
'itemFormElName'],
142 'evalList' => implode(
',', $evalList),
143 'is_in' => trim($config[
'is_in']),
145 'data-formengine-input-name' => $parameterArray[
'itemFormElName'],
148 if (isset($config[
'max']) && (
int)$config[
'max'] > 0) {
149 $attributes[
'maxlength'] = (int)$config[
'max'];
151 if (!empty($config[
'placeholder'])) {
152 $attributes[
'placeholder'] = trim($config[
'placeholder']);
154 if (isset($config[
'autocomplete'])) {
155 $attributes[
'autocomplete'] = empty($config[
'autocomplete']) ?
'new-' . $fieldName :
'on';
158 $valuePickerHtml = [];
159 if (isset($config[
'valuePicker'][
'items']) && is_array($config[
'valuePicker'][
'items'])) {
160 $valuePickerHtml[] =
'<select class="t3js-colorpicker-value-trigger form-control tceforms-select tceforms-wizardselect">';
161 $valuePickerHtml[] =
'<option></option>';
162 foreach ($config[
'valuePicker'][
'items'] as $item) {
163 $valuePickerHtml[] =
'<option value="' . htmlspecialchars($item[1]) .
'">' . htmlspecialchars($languageService->sL($item[0])) .
'</option>';
165 $valuePickerHtml[] =
'</select>';
169 $fieldWizardHtml = $fieldWizardResult[
'html'];
173 $fieldControlHtml = $fieldControlResult[
'html'];
177 $mainFieldHtml[] =
'<div class="form-control-wrap" style="max-width: ' . $width .
'px">';
178 $mainFieldHtml[] =
'<div class="form-wizards-wrap">';
179 $mainFieldHtml[] =
'<div class="form-wizards-element">';
180 $mainFieldHtml[] =
'<input type="text" ' . GeneralUtility::implodeAttributes($attributes,
true) .
' />';
181 $mainFieldHtml[] =
'<input type="hidden" name="' . $parameterArray[
'itemFormElName'] .
'" value="' . htmlspecialchars($itemValue) .
'" />';
182 $mainFieldHtml[] =
'</div>';
183 $mainFieldHtml[] =
'<div class="form-wizards-items-aside">';
184 $mainFieldHtml[] =
'<div class="btn-group">';
185 $mainFieldHtml[] = $fieldControlHtml;
186 $mainFieldHtml[] = implode(LF, $valuePickerHtml);
187 $mainFieldHtml[] =
'</div>';
188 $mainFieldHtml[] =
'</div>';
189 if (!empty($fieldWizardHtml)) {
190 $mainFieldHtml[] =
'<div class="form-wizards-items-bottom">';
191 $mainFieldHtml[] = $fieldWizardHtml;
192 $mainFieldHtml[] =
'</div>';
194 $mainFieldHtml[] =
'</div>';
195 $mainFieldHtml[] =
'</div>';
196 $mainFieldHtml = implode(LF, $mainFieldHtml);
198 $fullElement = $mainFieldHtml;
200 $checked = $itemValue !==
null ?
' checked="checked"' :
'';
202 $fullElement[] =
'<div class="t3-form-field-disable"></div>';
203 $fullElement[] =
'<div class="checkbox t3-form-field-eval-null-checkbox">';
204 $fullElement[] =
'<label for="' . $nullControlNameEscaped .
'">';
205 $fullElement[] =
'<input type="hidden" name="' . $nullControlNameEscaped .
'" value="0" />';
206 $fullElement[] =
'<input type="checkbox" name="' . $nullControlNameEscaped .
'" id="' . $nullControlNameEscaped .
'" value="1"' . $checked .
' />';
207 $fullElement[] = $languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.nullCheckbox');
208 $fullElement[] =
'</label>';
209 $fullElement[] =
'</div>';
210 $fullElement[] = $mainFieldHtml;
211 $fullElement = implode(LF, $fullElement);
213 $checked = $itemValue !==
null ?
' checked="checked"' :
'';
214 $placeholder = $shortenedPlaceholder = $config[
'placeholder'] ??
'';
217 if (strlen($placeholder) > 0) {
218 $shortenedPlaceholder = GeneralUtility::fixed_lgd_cs($placeholder, 20);
219 if ($placeholder !== $shortenedPlaceholder) {
220 $overrideLabel = sprintf(
221 $languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'),
222 '<span title="' . htmlspecialchars($placeholder) .
'">' . htmlspecialchars($shortenedPlaceholder) .
'</span>'
225 $overrideLabel = sprintf(
226 $languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'),
227 htmlspecialchars($placeholder)
231 $overrideLabel = $languageService->sL(
232 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
236 $fullElement[] =
'<div class="checkbox t3js-form-field-eval-null-placeholder-checkbox">';
237 $fullElement[] =
'<label for="' . $nullControlNameEscaped .
'">';
238 $fullElement[] =
'<input type="hidden" name="' . $nullControlNameEscaped .
'" value="' . $fallbackValue .
'" />';
239 $fullElement[] =
'<input type="checkbox" name="' . $nullControlNameEscaped .
'" id="' . $nullControlNameEscaped .
'" value="1"' . $checked . $disabled .
' />';
240 $fullElement[] = $overrideLabel;
241 $fullElement[] =
'</label>';
242 $fullElement[] =
'</div>';
243 $fullElement[] =
'<div class="t3js-formengine-placeholder-placeholder">';
244 $fullElement[] =
'<div class="form-control-wrap" style="max-width:' . $width .
'px">';
245 $fullElement[] =
'<input type="text" class="form-control" disabled="disabled" value="' . htmlspecialchars($shortenedPlaceholder) .
'" />';
246 $fullElement[] =
'</div>';
247 $fullElement[] =
'</div>';
248 $fullElement[] =
'<div class="t3js-formengine-placeholder-formfield">';
249 $fullElement[] = $mainFieldHtml;
250 $fullElement[] =
'</div>';
251 $fullElement = implode(LF, $fullElement);
254 $resultArray[
'html'] =
'<div class="formengine-field-item t3js-formengine-field-item">' . $fieldInformationHtml . $fullElement .
'</div>';