[BUGFIX] Collapse excludefield lists by default 49/44349/3
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Thu, 29 Oct 2015 11:48:32 +0000 (12:48 +0100)
committerBenjamin Kott <info@bk2k.info>
Thu, 29 Oct 2015 12:06:22 +0000 (13:06 +0100)
In order to make the exclude field lists shorter and easier to manage,
we collapse checkbox groups with headers.

Resolves: #71122
Releases: master
Change-Id: I5b3cf30619f69b6592efbf926e529b3e9eb1e1a7
Reviewed-on: https://review.typo3.org/44349
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php

index 4596058..977332b 100644 (file)
@@ -142,7 +142,7 @@ class SelectCheckBoxElement extends AbstractFormElement
                 $html[] = '<div class="panel panel-default">';
                 if (is_array($group['header'])) {
                     $html[] = '<div class="panel-heading">';
-                    $html[] = '<a data-toggle="collapse" href="#' . $groupId . '" aria-expanded="true" aria-controls="' . $groupId . '">';
+                    $html[] = '<a data-toggle="collapse" href="#' . $groupId . '" aria-expanded="false" aria-controls="' . $groupId . '">';
                     $html[] = $group['header']['icon'];
                     $html[] = $group['header']['title'];
                     $html[] = '</a>';
@@ -200,7 +200,9 @@ class SelectCheckBoxElement extends AbstractFormElement
                             . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.revertSelection') . '</a>';
                     }
 
-                    $html[] = '<div id="' . $groupId . '" class="panel-collapse collapse in" role="tabpanel">';
+                    if (is_array($group['header'])) {
+                        $html[] = '<div id="' . $groupId . '" class="panel-collapse collapse" role="tabpanel">';
+                    }
                     $html[] =    '<div class="table-fit">';
                     $html[] =        '<table class="table table-transparent table-hover">';
                     $html[] =            '<thead>';
@@ -213,7 +215,9 @@ class SelectCheckBoxElement extends AbstractFormElement
                     $html[] =            '<tbody>' . implode(LF, $tableRows) . '</tbody>';
                     $html[] =        '</table>';
                     $html[] =    '</div>';
-                    $html[] = '</div>';
+                    if (is_array($group['header'])) {
+                        $html[] = '</div>';
+                    }
                 }
                 $html[] = '</div>';
             }