Added feature #8523: IRRE - Integrate possibility to define enabledControls in TCA
authorOliver Hader <oliver.hader@typo3.org>
Tue, 28 Oct 2008 18:42:20 +0000 (18:42 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 28 Oct 2008 18:42:20 +0000 (18:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4365 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms_inline.php

index 16c583c..f156991 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
        * Fixed bug #9665: t3lib_BEfunc has a lot of hanging SQL record sets
        * Fixed bug #9664: EM fails on retrieving files of uppercase extension keys (thanks to Marcus Krause)
        * Added feature #7571: FeUsers in table sys_lockedrecords (thanks to Stefan Geith)
+       * Added feature #8523: IRRE - Integrate possibility to define enabledControls in TCA
 
 2008-10-24  Oliver Hader  <oliver@typo3.org>
 
index b1153d6..3c373f4 100755 (executable)
@@ -576,15 +576,7 @@ class t3lib_TCEforms_inline {
                $permsEdit = ($isPagesTable && ($localCalcPerms&2)) || (!$isPagesTable && ($calcPerms&16));
 
                        // Controls: Defines which controls should be shown
-               $enabledControls = array(
-                       'info'          => true,
-                       'new'           => true,
-                       'dragdrop'      => true,
-                       'sort'          => true,
-                       'hide'          => true,
-                       'delete'        => true,
-                       'localize'      => true,
-               );
+               $enabledControls = $config['appearance']['enabledControls'];
                        // Hook: Can disable/enable single controls for specific child records:
                foreach ($this->hookObjects as $hookObj)        {
                        $hookObj->renderForeignRecordHeaderControl_preProcess($parentUid, $foreign_table, $rec, $config, $isVirtual, $enabledControls);
@@ -1820,6 +1812,21 @@ class t3lib_TCEforms_inline {
                } elseif (!isset($config['appearance']['levelLinksPosition']) || !in_array($config['appearance']['levelLinksPosition'], array('top', 'bottom', 'both', 'none'))) {
                        $config['appearance']['levelLinksPosition'] = 'top';
                }
+                       // Defines which controls should be shown in header of each record:
+               $enabledControls = array(
+                       'info'          => true,
+                       'new'           => true,
+                       'dragdrop'      => true,
+                       'sort'          => true,
+                       'hide'          => true,
+                       'delete'        => true,
+                       'localize'      => true,
+               );
+               if (isset($config['appearance']['enabledControls']) && is_array($config['appearance']['enabledControls'])) {
+                       $config['appearance']['enabledControls'] = array_merge($enabledControls, $config['appearance']['enabledControls']);
+               } else {
+                       $config['appearance']['enabledControls'] = $enabledControls;
+               }
 
                return true;
        }