From abe66ba6835f2afda57efa4fff85862a030989bd Mon Sep 17 00:00:00 2001
From: Simon Gilli <typo3@gilbertsoft.org>
Date: Fri, 13 Apr 2018 03:26:06 +0200
Subject: [PATCH] [TASK] Add Site Configuration to ConfigurationController

Add the Site Configuration to the ConfigurationController to
simplify debugging and enable its inspection at the backend.

Resolves: #84709
Releases: master
Change-Id: Ib0720f372a2d27873fda9931c8753c7ed6a98750
Reviewed-on: https://review.typo3.org/56644
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
---
 .../Classes/Controller/ConfigurationController.php         | 7 +++++++
 .../lowlevel/Resources/Private/Language/locallang.xlf      | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php b/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
index ed6275cf6060..50c9e3240899 100644
--- a/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
+++ b/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Lowlevel\Controller;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
+use TYPO3\CMS\Backend\Configuration\SiteTcaConfiguration;
 use TYPO3\CMS\Backend\Routing\Router;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
@@ -113,6 +114,10 @@ class ConfigurationController
             'label' => 'httpMiddlewareStacks',
             'type' => 'httpMiddlewareStacks',
         ],
+        'siteConfiguration' => [
+            'label' => 'siteConfiguration',
+            'type' => 'siteConfiguration',
+        ],
     ];
 
     /**
@@ -238,6 +243,8 @@ class ConfigurationController
                 // reversing the array allows the admin to read the stack from top to bottom
                 $renderArray[$stackName] = array_reverse($stackResolver->resolve($stackName));
             }
+        } elseif ($selectedTreeDetails['type'] === 'siteConfiguration') {
+            $renderArray = GeneralUtility::makeInstance(SiteTcaConfiguration::class)->getTca();
         } else {
             throw new \RuntimeException('Unknown array type "' . $selectedTreeDetails['type'] . '"', 1507845662);
         }
diff --git a/typo3/sysext/lowlevel/Resources/Private/Language/locallang.xlf b/typo3/sysext/lowlevel/Resources/Private/Language/locallang.xlf
index ed3952833b16..93ca8c8bdbc8 100644
--- a/typo3/sysext/lowlevel/Resources/Private/Language/locallang.xlf
+++ b/typo3/sysext/lowlevel/Resources/Private/Language/locallang.xlf
@@ -36,6 +36,9 @@
 			<trans-unit id="httpMiddlewareStacks">
 				<source>HTTP Middlewares (PSR-15)</source>
 			</trans-unit>
+			<trans-unit id="siteConfiguration">
+				<source>Site Configuration</source>
+			</trans-unit>
 			<trans-unit id="t3services">
 				<source>$GLOBALS['T3_SERVICES'] (Registered Services)</source>
 			</trans-unit>
-- 
GitLab