[FEATURE] Add option to hide group field move buttons 31/39631/3
authorMathias Brodala <mbrodala@pagemachine.de>
Wed, 20 May 2015 12:44:49 +0000 (14:44 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 5 Aug 2015 20:18:13 +0000 (22:18 +0200)
This adds an TCA option to explicitely hide the move buttons of
TCA "group" fields. As of now these icons can only be hidden
automatically if "maxitems" is set to 1.

Resolves: #67056
Releases: master
Change-Id: I01e65eaeb977dadff0be84593962d8543c8545dd
Reviewed-on: http://review.typo3.org/39631
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/Element/GroupElement.php
typo3/sysext/core/Documentation/Changelog/master/Feature-67056-AddOptionToDisableMoveButtonsTCAGroupType.rst [new file with mode: 0644]

index ab34e4e..897f124 100644 (file)
@@ -175,7 +175,7 @@ class GroupElement extends AbstractFormElement {
                                        'size' => $size,
                                        'allowed' => $allowed,
                                        'disallowed' => $disallowed,
-                                       'dontShowMoveIcons' => $maxitems <= 1,
+                                       'dontShowMoveIcons' => isset($config['hideMoveIcons']) || $maxitems <= 1,
                                        'autoSizeMax' => MathUtility::forceIntegerInRange($config['autoSizeMax'], 0),
                                        'maxitems' => $maxitems,
                                        'style' => isset($config['selectedListStyle'])
@@ -227,7 +227,7 @@ class GroupElement extends AbstractFormElement {
                                // Creating the element:
                                $params = array(
                                        'size' => $size,
-                                       'dontShowMoveIcons' => $maxitems <= 1,
+                                       'dontShowMoveIcons' => isset($config['hideMoveIcons']) || $maxitems <= 1,
                                        'autoSizeMax' => MathUtility::forceIntegerInRange($config['autoSizeMax'], 0),
                                        'maxitems' => $maxitems,
                                        'style' => isset($config['selectedListStyle'])
@@ -295,7 +295,7 @@ class GroupElement extends AbstractFormElement {
                                // Creating the element:
                                $params = array(
                                        'size' => $size,
-                                       'dontShowMoveIcons' => $maxitems <= 1,
+                                       'dontShowMoveIcons' => isset($config['hideMoveIcons']) || $maxitems <= 1,
                                        'autoSizeMax' => MathUtility::forceIntegerInRange($config['autoSizeMax'], 0),
                                        'maxitems' => $maxitems,
                                        'style' => isset($config['selectedListStyle'])
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-67056-AddOptionToDisableMoveButtonsTCAGroupType.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-67056-AddOptionToDisableMoveButtonsTCAGroupType.rst
new file mode 100644 (file)
index 0000000..a9ed3af
--- /dev/null
@@ -0,0 +1,29 @@
+===================================================================
+Feature: #67056 - Add option to disable move buttons TCA group type
+===================================================================
+
+Description
+===========
+
+The move buttons of the TCA type ``group`` can now be explicitly disabled with the
+``hideMoveIcons`` option. Before these icons where only automatically removed if
+``maxitems`` was set to 1.
+
+.. code-block:: [php]
+
+       'options' => array(
+               'label' => 'Options',
+               'config' => array(
+                       'type' => 'group',
+                       'internal_type' => 'db',
+                       'allowed' => 'pages',
+                       'maxitems' => 9999,
+                       'hideMoveIcons' => TRUE,
+               ),
+       ),
+
+
+Impact
+======
+
+Move buttons can now always be hidden for ``group`` fields