38 'renderType' =>
'tcaDescription',
49 'renderType' =>
'editPopup',
53 'renderType' =>
'addRecord',
55 'after' => [
'editPopup' ],
58 'renderType' =>
'listModule',
60 'after' => [
'addRecord' ],
70 'localizationStateSelector' => [
71 'renderType' =>
'localizationStateSelector',
73 'otherLanguageContent' => [
74 'renderType' =>
'otherLanguageContent',
76 'localizationStateSelector'
79 'defaultLanguageDifferences' => [
80 'renderType' =>
'defaultLanguageDifferences',
82 'otherLanguageContent',
97 $parameterArray = $this->data[
'parameterArray'];
98 $config = $parameterArray[
'fieldConf'][
'config'];
99 $elementName = $parameterArray[
'itemFormElName'];
101 if ($config[
'readOnly']) {
106 $possibleItems = $config[
'items'];
107 $selectedItems = $parameterArray[
'itemFormElValue'] ?: [];
108 $selectedItemsCount = count($selectedItems);
110 $maxItems = $config[
'maxitems'];
113 if (isset($config[
'size'])) {
114 $size = (int)$config[
'size'];
116 if ($autoSizeMax >= 1) {
119 $itemCanBeSelectedMoreThanOnce = !empty($config[
'multiple']);
121 $listOfSelectedValues = [];
122 $selectedItemsHtml = [];
123 foreach ($selectedItems as $itemValue) {
124 foreach ($possibleItems as $possibleItem) {
125 if ($possibleItem[1] == $itemValue) {
126 $title = $possibleItem[0];
127 $listOfSelectedValues[] = $itemValue;
128 $selectedItemsHtml[] =
'<option value="' . htmlspecialchars($itemValue) .
'" title="' . htmlspecialchars($title) .
'">' . htmlspecialchars($this->
appendValueToLabelInDebugMode($title, $itemValue)) .
'</option>';
134 $selectableItemsHtml = [];
135 foreach ($possibleItems as $possibleItem) {
138 if (!$itemCanBeSelectedMoreThanOnce && in_array((
string)$possibleItem[1], $selectedItems,
true)) {
139 $disabledAttr =
' disabled="disabled"';
140 $classAttr =
' class="hidden"';
142 $selectableItemsHtml[] =
144 . htmlspecialchars($possibleItem[1])
145 .
'" title="' . htmlspecialchars($possibleItem[0]) .
'"'
146 . $classAttr . $disabledAttr
153 $filterTextfield = [];
154 if ($config[
'enableMultiSelectFilterTextfield']) {
155 $filterTextfield[] =
'<span class="input-group input-group-sm">';
156 $filterTextfield[] =
'<span class="input-group-addon">';
157 $filterTextfield[] =
'<span class="fa fa-filter"></span>';
158 $filterTextfield[] =
'</span>';
159 $filterTextfield[] =
'<input class="t3js-formengine-multiselect-filter-textfield form-control" value="">';
160 $filterTextfield[] =
'</span>';
162 $filterDropDownOptions = [];
163 if (isset($config[
'multiSelectFilterItems']) && is_array($config[
'multiSelectFilterItems']) && count($config[
'multiSelectFilterItems']) > 1) {
164 foreach ($config[
'multiSelectFilterItems'] as $optionElement) {
165 $value = $languageService->sL($optionElement[0]);
167 if (isset($optionElement[1]) && trim($optionElement[1]) !==
'') {
168 $label = $languageService->sL($optionElement[1]);
170 $filterDropDownOptions[] =
'<option value="' . htmlspecialchars($value) .
'">' . htmlspecialchars($label) .
'</option>';
174 if (!empty($filterTextfield) || !empty($filterDropDownOptions)) {
175 $filterHtml[] =
'<div class="form-multigroup-item-wizard">';
176 if (!empty($filterTextfield) && !empty($filterDropDownOptions)) {
177 $filterHtml[] =
'<div class="t3js-formengine-multiselect-filter-container form-multigroup-wrap">';
178 $filterHtml[] =
'<div class="form-multigroup-item form-multigroup-element">';
179 $filterHtml[] =
'<select class="form-control input-sm t3js-formengine-multiselect-filter-dropdown">';
180 $filterHtml[] = implode(LF, $filterDropDownOptions);
181 $filterHtml[] =
'</select>';
182 $filterHtml[] =
'</div>';
183 $filterHtml[] =
'<div class="form-multigroup-item form-multigroup-element">';
184 $filterHtml[] = implode(LF, $filterTextfield);
185 $filterHtml[] =
'</div>';
186 $filterHtml[] =
'</div>';
187 } elseif (!empty($filterTextfield)) {
188 $filterHtml[] = implode(LF, $filterTextfield);
190 $filterHtml[] =
'<select class="form-control input-sm t3js-formengine-multiselect-filter-dropdown">';
191 $filterHtml[] = implode(LF, $filterDropDownOptions);
192 $filterHtml[] =
'</select>';
194 $filterHtml[] =
'</div>';
198 $classes[] =
'form-control';
199 $classes[] =
'tceforms-multiselect';
200 if ($maxItems === 1) {
201 $classes[] =
'form-select-no-siblings';
203 $multipleAttribute =
'';
204 if ($maxItems !== 1 && $size !== 1) {
205 $multipleAttribute =
' multiple="multiple"';
209 $fieldInformationHtml = $fieldInformationResult[
'html'];
213 $fieldControlHtml = $fieldControlResult[
'html'];
217 $fieldWizardHtml = $fieldWizardResult[
'html'];
221 $html[] =
'<div class="formengine-field-item t3js-formengine-field-item">';
222 $html[] = $fieldInformationHtml;
223 $html[] =
'<div class="form-wizards-wrap">';
224 $html[] =
'<div class="form-wizards-element">';
225 $html[] =
'<input type="hidden" data-formengine-input-name="' . htmlspecialchars($elementName) .
'" value="' . (int)$itemCanBeSelectedMoreThanOnce .
'" />';
226 $html[] =
'<div class="form-multigroup-wrap t3js-formengine-field-group">';
227 $html[] =
'<div class="form-multigroup-item form-multigroup-element">';
229 $html[] = htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.selected'));
230 $html[] =
'</label>';
231 $html[] =
'<div class="form-wizards-wrap form-wizards-aside">';
232 $html[] =
'<div class="form-wizards-element">';
235 $html[] =
' size="' . $size .
'"';
236 $html[] =
' class="' . implode(
' ', $classes) .
'"';
237 $html[] = $multipleAttribute;
238 $html[] =
' data-formengine-input-name="' . htmlspecialchars($elementName) .
'"';
240 $html[] = implode(LF, $selectedItemsHtml);
241 $html[] =
'</select>';
243 $html[] =
'<div class="form-wizards-items-aside">';
244 $html[] =
'<div class="btn-group-vertical">';
245 if ($maxItems > 1 && $size >= 5) {
246 $html[] =
'<a href="#"';
247 $html[] =
' class="btn btn-default t3js-btn-moveoption-top"';
248 $html[] =
' data-fieldname="' . htmlspecialchars($elementName) .
'"';
249 $html[] =
' title="' . htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.move_to_top')) .
'"';
251 $html[] = $this->iconFactory->getIcon(
'actions-move-to-top',
Icon::SIZE_SMALL)->render();
255 $html[] =
'<a href="#"';
256 $html[] =
' class="btn btn-default t3js-btn-moveoption-up"';
257 $html[] =
' data-fieldname="' . htmlspecialchars($elementName) .
'"';
258 $html[] =
' title="' . htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.move_up')) .
'"';
260 $html[] = $this->iconFactory->getIcon(
'actions-move-up',
Icon::SIZE_SMALL)->render();
262 $html[] =
'<a href="#"';
263 $html[] =
' class="btn btn-default t3js-btn-moveoption-down"';
264 $html[] =
' data-fieldname="' . htmlspecialchars($elementName) .
'"';
265 $html[] =
' title="' . htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.move_down')) .
'"';
267 $html[] = $this->iconFactory->getIcon(
'actions-move-down',
Icon::SIZE_SMALL)->render();
270 if ($maxItems > 1 && $size >= 5) {
271 $html[] =
'<a href="#"';
272 $html[] =
' class="btn btn-default t3js-btn-moveoption-bottom"';
273 $html[] =
' data-fieldname="' . htmlspecialchars($elementName) .
'"';
274 $html[] =
' title="' . htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.move_to_bottom')) .
'"';
276 $html[] = $this->iconFactory->getIcon(
'actions-move-to-bottom',
Icon::SIZE_SMALL)->render();
279 $html[] =
'<a href="#"';
280 $html[] =
' class="btn btn-default t3js-btn-removeoption"';
281 $html[] =
' data-fieldname="' . htmlspecialchars($elementName) .
'"';
282 $html[] =
' title="' . htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.remove_selected')) .
'"';
284 $html[] = $this->iconFactory->getIcon(
'actions-selection-delete',
Icon::SIZE_SMALL)->render();
290 $html[] =
'<div class="form-multigroup-item form-multigroup-element">';
292 $html[] = htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.items'));
293 $html[] =
'</label>';
294 $html[] =
'<div class="form-wizards-wrap form-wizards-aside">';
295 $html[] =
'<div class="form-wizards-element">';
296 $html[] = implode(LF, $filterHtml);
298 $html[] =
' data-relatedfieldname="' . htmlspecialchars($elementName) .
'"';
299 $html[] =
' data-exclusivevalues="' . htmlspecialchars($config[
'exclusiveKeys']) .
'"';
301 $html[] =
' data-formengine-input-name="' . htmlspecialchars($elementName) .
'"';
302 $html[] =
' class="form-control t3js-formengine-select-itemstoselect"';
303 $html[] =
' size="' . $size .
'"';
304 $html[] =
' onchange="' . htmlspecialchars(implode(
'', $parameterArray[
'fieldChangeFunc'])) .
'"';
307 $html[] = implode(LF, $selectableItemsHtml);
308 $html[] =
'</select>';
310 if (!empty($fieldControlHtml)) {
311 $html[] =
'<div class="form-wizards-items-aside">';
312 $html[] =
'<div class="btn-group-vertical">';
313 $html[] = $fieldControlHtml;
320 $html[] =
'<input type="hidden" name="' . htmlspecialchars($elementName) .
'" value="' . htmlspecialchars(implode(
',', $listOfSelectedValues)) .
'" />';
322 if (!empty($fieldWizardHtml)) {
323 $html[] =
'<div class="form-wizards-items-bottom">';
324 $html[] = $fieldWizardHtml;
330 $resultArray[
'html'] = implode(LF, $html);
345 $parameterArray = $this->data[
'parameterArray'];
346 $config = $parameterArray[
'fieldConf'][
'config'];
347 $fieldName = $parameterArray[
'itemFormElName'];
349 $possibleItems = $config[
'items'];
350 $selectedItems = $parameterArray[
'itemFormElValue'] ?: [];
351 if (!is_array($selectedItems)) {
352 $selectedItems = GeneralUtility::trimExplode(
',', $selectedItems,
true);
354 $selectedItemsCount = count($selectedItems);
358 if (isset($config[
'size'])) {
359 $size = (int)$config[
'size'];
361 if ($autoSizeMax >= 1) {
366 $multiple =
' multiple="multiple"';
369 $listOfSelectedValues = [];
371 foreach ($selectedItems as $itemValue) {
372 foreach ($possibleItems as $possibleItem) {
373 if ($possibleItem[1] == $itemValue) {
374 $title = $possibleItem[0];
375 $listOfSelectedValues[] = $itemValue;
376 $optionsHtml[] =
'<option value="' . htmlspecialchars($itemValue) .
'" title="' . htmlspecialchars($title) .
'">' . htmlspecialchars($title) .
'</option>';
383 $fieldInformationHtml = $fieldInformationResult[
'html'];
387 $html[] =
'<div class="formengine-field-item t3js-formengine-field-item">';
388 $html[] = $fieldInformationHtml;
389 $html[] =
'<div class="form-wizards-wrap">';
390 $html[] =
'<div class="form-wizards-element">';
392 $html[] = htmlspecialchars($languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.selected'));
393 $html[] =
'</label>';
394 $html[] =
'<div class="form-wizards-wrap form-wizards-aside">';
395 $html[] =
'<div class="form-wizards-element">';
398 $html[] =
' size="' . $size .
'"';
399 $html[] =
' class="form-control tceforms-multiselect"';
401 $html[] =
' data-formengine-input-name="' . htmlspecialchars($fieldName) .
'"';
402 $html[] =
' disabled="disabled">';
404 $html[] = implode(LF, $optionsHtml);
405 $html[] =
'</select>';
408 $html[] =
'<input type="hidden" name="' . htmlspecialchars($fieldName) .
'" value="' . htmlspecialchars(implode(
',', $listOfSelectedValues)) .
'" />';
413 $resultArray[
'html'] = implode(LF, $html);