[FEATURE] Support custom width in TCA tree
authorDominique Feyer <dfeyer@ttree.ch>
Tue, 17 Jul 2012 23:22:49 +0000 (01:22 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 18 Aug 2012 12:10:33 +0000 (14:10 +0200)
Introduce setting ['config']['treeConfig']['appearance']['width']
to apply custom width for TCA select fields that use the tce tree.

Change-Id: I757745e51f650c20f23e60aa6c4a9b7b0fca6b99
Releases: 6.0
Resolves: #39046
Reviewed-on: http://review.typo3.org/12860
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/tceforms/class.t3lib_tceforms_tree.php

index c66aace..c7519ef 100644 (file)
@@ -135,10 +135,14 @@ class t3lib_TCEforms_Tree {
 
                $header = FALSE;
                $expanded = FALSE;
+               $width = 280;
                $appearance = $PA['fieldConf']['config']['treeConfig']['appearance'];
                if (is_array($appearance)) {
                        $header = $appearance['showHeader'] ? TRUE : FALSE;
                        $expanded = ($appearance['expandAll'] === TRUE);
+                       if (isset($appearance['width'])) {
+                               $width = intval($appearance['width']);
+                       }
                }
 
                $onChange = '';
@@ -172,6 +176,7 @@ class t3lib_TCEforms_Tree {
                                showHeader: ' . intval($header) . ',
                                onChange: "' . $onChange . '",
                                countSelectedNodes: ' . count ($selectedNodes) . ',
+                               width: ' . $width . ',
                                listeners: {
                                        click: function(node, event) {
                                                if (typeof(node.attributes.checked) == "boolean") {