[FEATURE] Add SQL Logging to AdminPanel
[Packages/TYPO3.CMS.git] / typo3 / sysext / adminpanel / Classes / Hooks / RenderHook.php
index a92269f..21d4db5 100644 (file)
@@ -17,35 +17,34 @@ namespace TYPO3\CMS\Adminpanel\Hooks;
  */
 
 use TYPO3\CMS\Adminpanel\Controller\MainController;
-use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
+use TYPO3\CMS\Adminpanel\Utility\StateUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 
 /**
  * Hook to render the admin panel
+ *
+ * @internal
  */
 class RenderHook
 {
-
     /**
      * Hook to render the admin panel
      * We use a hook this late in the project to make sure all data is collected and can be displayed
-     *
      * As the main content is already rendered, we use a string replace on the content to append the adminPanel
      * to the HTML body.
      *
      * @param array $params
      * @param TypoScriptFrontendController $pObj
      */
-    public function renderAdminPanel(array $params, TypoScriptFrontendController $pObj)
+    public function renderAdminPanel(array $params, TypoScriptFrontendController $pObj): void
     {
-        if ($pObj->isBackendUserLoggedIn() &&
-            $GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication &&
-            (
-                !$GLOBALS['BE_USER']->extAdminConfig['hide'] && $pObj->config['config']['admPanel']
-            )
+        if (
+            StateUtility::isActivated() &&
+            !$GLOBALS['BE_USER']->extAdminConfig['hide'] && $pObj->config['config']['admPanel']
         ) {
             $mainController = GeneralUtility::makeInstance(MainController::class);
+
             $pObj->content = str_ireplace(
                 '</body>',
                 $mainController->render() . '</body>',