Fixed bug #16276: TCAtree should respect maxItems = 1
authorSteffen Ritter <info@rs-websystems.de>
Mon, 29 Nov 2010 14:36:05 +0000 (14:36 +0000)
committerSteffen Ritter <info@rs-websystems.de>
Mon, 29 Nov 2010 14:36:05 +0000 (14:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9673 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/js/extjs/tree/tree.js
t3lib/tceforms/class.t3lib_tceforms_tree.php

index 99216c5..aaf449a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
        * Follow-up to bug #16600: TCA tree: Move the ACL-Checks out from Data-Provider and use the information from tceFroms (added missing class)
        * Fixed bug #16553: TCA tree does not work for relation-fields without TCA Definition.
        * Cleanup #16553: TCA tree has redundant code passages 
+       * Fixed bug #16276: TCAtree should respect maxItems = 1
 
 2010-11-29  Jigal van Hemert <jigal@xs4all.nl>
 
index 7fa3f7b..42bc047 100644 (file)
@@ -214,6 +214,7 @@ TYPO3.Components.Tree.TcaCheckChangeHandler = function(checkedNode, checked) {
        if (this.countSelectedNodes >= this.tcaMaxItems) {
                checkedNode.attributes.checked = false;
                checkedNode.getUI().toggleCheck(false);
+               this.resumeEvents();
                return false;
        }
        if (checked) {
index 3cb5a37..3b3bfc7 100644 (file)
@@ -151,10 +151,10 @@ class t3lib_TCEforms_Tree {
                $pageRenderer->addExtOnReadyCode('
                        TYPO3.Components.Tree.StandardTreeItemData["' . $id . '"] = ' . $treeData . ';
                        var tree' . $id . ' = new TYPO3.Components.Tree.StandardTree({
-                               checkChangeHandler: TYPO3.Components.Tree.TcaCheckChangeHandler,
                                id: "' . $id . '",
                                showHeader: ' . intval($header) . ',
                                onChange: "' . $onChange . '",
+                               countSelectedNodes: ' . count ($selectedNodes) . ',
                                listeners: {
                                        click: function(node, event) {
                                                if (typeof(node.attributes.checked) == "boolean") {
@@ -167,7 +167,8 @@ class t3lib_TCEforms_Tree {
                                                        node.attributes.checked = ! node.attributes.checked;
                                                        node.getUI().toggleCheck(node.attributes.checked);
                                                }
-                                       }
+                                       },
+                                       checkchange: TYPO3.Components.Tree.TcaCheckChangeHandler
                                },
                                tcaMaxItems: ' . ($PA['fieldConf']['config']['maxitems'] ? intval($PA['fieldConf']['config']['maxitems']) : 99999) . ',
                                tcaExclusiveKeys: "' . (