[BUGFIX] Disable the TCA Tree if $PA['fieldConf']['config']['readOnly'] is true.
authorMarco Huber <mail@marco-huber.de>
Mon, 11 Apr 2011 13:15:19 +0000 (15:15 +0200)
committerOliver Hader <oliver@typo3.org>
Tue, 12 Apr 2011 11:54:00 +0000 (13:54 +0200)
Disable the TCA Tree if $PA['fieldConf']['config']['readOnly'] is true.
This happens for example in translations of records if
$TCA['my_table']['columns']['my_column']['l10n_display'] = 'defaultAsReadonly'.

Change-Id: Ib5e11aa80d55a6f74e4fc439ca8537dc8ed0e45b
Resolves: #25888
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/1560
Reviewed-by: Marco Huber
Tested-by: Marco Huber
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
t3lib/tceforms/class.t3lib_tceforms_tree.php

index 9668582..3d00055 100644 (file)
@@ -182,7 +182,8 @@ class t3lib_TCEforms_Tree {
                $PA['fieldConf']['config']['exclusiveKeys']
                                ? $PA['fieldConf']['config']['exclusiveKeys'] : '') . '",
                                ucId: "' . md5($table . '|' . $field) . '",
-                               selModel: TYPO3.Components.Tree.EmptySelectionModel
+                               selModel: TYPO3.Components.Tree.EmptySelectionModel,
+                               disabled: ' . ($PA['fieldConf']['config']['readOnly'] ? 'true' : 'false') . '
                        });' . LF .
                        ($autoSizeMax
                                ? 'tree' . $id . '.bodyStyle = "max-height: ' . $autoSizeMax . 'px;min-height: ' . $height . 'px;";'
@@ -209,4 +210,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['classes/t3lib/tceforms/class.t3lib_tceforms_tree.php']);
 }
 
-?>
\ No newline at end of file
+?>