2 namespace TYPO3\CMS\Backend\Form\Element;
39 $parameterArray = $this->data[
'parameterArray'];
40 $config = $parameterArray[
'fieldConf'][
'config'];
41 $disabled = !empty($config[
'readOnly']);
43 $selItems = $config[
'items'];
44 if (!empty($selItems)) {
46 $itemArray = array_flip($parameterArray[
'itemFormElValue']);
54 $sOnChange = implode(
'', $parameterArray[
'fieldChangeFunc']);
56 foreach ($selItems as $p) {
58 if ($p[1] ===
'--div--') {
60 if (isset($p[2]) && $p[2] !=
'empty-empty') {
64 $groups[$currentGroup][
'header'] = array(
66 'title' => htmlspecialchars($p[0])
80 if (is_array($p[3])) {
83 $helpArray[
'description'] = $p[3];
87 $help = BackendUtility::wrapInHelp(
'',
'',
'', $helpArray);
92 if (isset($itemArray[$p[1]])) {
94 unset($itemArray[$p[1]]);
98 $groups[$currentGroup][
'items'][] = array(
100 'name' => $parameterArray[
'itemFormElName'] .
'[' . $c .
']',
102 'checked' => $checked,
106 'title' => htmlspecialchars($p[0], ENT_COMPAT,
'UTF-8',
false),
114 $html[] =
'<input type="hidden" class="select-checkbox" name="' . htmlspecialchars($parameterArray[
'itemFormElName']) .
'" value="">';
117 foreach ($groups as $groupKey => $group) {
118 $groupId = htmlspecialchars($parameterArray[
'itemFormElID']) .
'-group-' . $groupKey;
119 $html[] =
'<div class="panel panel-default">';
120 if (is_array($group[
'header'])) {
121 $html[] =
'<div class="panel-heading">';
122 $html[] =
'<a data-toggle="collapse" href="#' . $groupId .
'" aria-expanded="false" aria-controls="' . $groupId .
'">';
123 $html[] = $group[
'header'][
'icon'];
124 $html[] = $group[
'header'][
'title'];
128 if (is_array($group[
'items']) && !empty($group[
'items'])) {
130 $checkGroup = array();
131 $uncheckGroup = array();
132 $resetGroup = array();
135 foreach ($group[
'items'] as $item) {
136 $tableRows[] =
'<tr class="' . $item[
'class'] .
'">';
137 $tableRows[] =
'<td class="col-checkbox">';
138 $tableRows[] =
'<input type="checkbox" '
139 .
'id="' . $item[
'id'] .
'" '
140 .
'name="' . htmlspecialchars($item[
'name']) .
'" '
141 .
'value="' . htmlspecialchars($item[
'value']) .
'" '
142 .
'onclick="' . htmlspecialchars($sOnChange) .
'" '
143 . ($item[
'checked'] ?
'checked=checked ' :
'')
144 . ($item[
'disabled'] ?
'disabled=disabled ' :
'')
145 . $parameterArray[
'onFocus'] .
'>';
146 $tableRows[] =
'</td>';
147 $tableRows[] =
'<td class="col-icon">';
148 $tableRows[] =
'<label class="label-block" for="' . $item[
'id'] .
'">' . $item[
'icon'] .
'</label>';
149 $tableRows[] =
'</td>';
150 $tableRows[] =
'<td class="col-title">';
151 $tableRows[] =
'<label class="label-block" for="' . $item[
'id'] .
'">' . $item[
'title'] .
'</label>';
152 $tableRows[] =
'</td>';
153 $tableRows[] =
'<td>' . $item[
'help'] .
'</td>';
154 $tableRows[] =
'</tr>';
161 $toggleGroupCheckbox =
'';
162 if (!empty($resetGroup)) {
163 $toggleGroupCheckbox =
'<input type="checkbox" '
164 .
'class="checkbox" '
165 .
'onclick="if (checked) {' . htmlspecialchars(implode(
'', $checkGroup) .
'} else {' . implode(
'', $uncheckGroup)) .
'}">';
170 if (!empty($resetGroup)) {
171 $title = $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.revertSelection',
true);
172 $resetGroupBtn =
'<a href="#" '
173 .
'class="btn btn-default" '
174 .
'onclick="' . implode(
'', $resetGroup) .
' return false;" '
175 .
'title="' . $title .
'">'
176 . $this->iconFactory->getIcon(
'actions-edit-undo',
Icon::SIZE_SMALL)->render() .
' '
177 . $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.revertSelection') .
'</a>';
180 if (is_array($group[
'header'])) {
181 $html[] =
'<div id="' . $groupId .
'" class="panel-collapse collapse" role="tabpanel">';
183 $html[] =
'<div class="table-fit">';
184 $html[] =
'<table class="table table-transparent table-hover">';
187 $html[] =
'<th class="col-checkbox">' . $toggleGroupCheckbox .
'</th>';
188 $html[] =
'<th class="col-icon"></th>';
189 $html[] =
'<th class="text-right" colspan="2">' . $resetGroupBtn .
'</th>';
191 $html[] =
'</thead>';
192 $html[] =
'<tbody>' . implode(LF, $tableRows) .
'</tbody>';
193 $html[] =
'</table>';
195 if (is_array($group[
'header'])) {
204 $html = $this->renderWizards(
205 array(implode(LF, $html)),
207 $this->data[
'tableName'],
208 $this->data[
'databaseRow'],
209 $this->data[
'fieldName'],
211 $parameterArray[
'itemFormElName'],
217 $resultArray[
'html'] = $html;