[BUGFIX] No possibility to hide "New" button in Inline Elements 17/45017/5
authorGernot Schulmeister <gernotschulmeister@gmx.at>
Sat, 28 Nov 2015 15:28:14 +0000 (16:28 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Sun, 29 Nov 2015 18:33:25 +0000 (19:33 +0100)
Hide "New" Button in TCA with
['appearance']['enabledControls']['new'] = false

Change-Id: I4b9d3ba1ef55f15127fcedfe0e5fcc5f3515a1b9
Resolves: #71918
Releases: master
Reviewed-on: https://review.typo3.org/45017
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Gianluigi Martino <gmartino27@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php

index e61fe5f..e0f22cd 100644 (file)
@@ -244,8 +244,10 @@ class InlineControlContainer extends AbstractContainer
         }
 
         // Render the level links (create new record):
-        $levelLinks = $this->getLevelInteractionLink('newRecord', $nameObject . '-' . $foreign_table, $config);
-
+        $levelLinks = '';
+        if (!empty($config['appearance']['enabledControls']['new'])) {
+            $levelLinks = $this->getLevelInteractionLink('newRecord', $nameObject . '-' . $foreign_table, $config);
+        }
         // Wrap all inline fields of a record with a <div> (like a container)
         $html = '<div class="form-group" id="' . $nameObject . '">';
         // Add the level links before all child records: