[TASK] Streamline phpdoc annotations in EXT:fluid
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / Core / ViewHelper / ViewHelperResolver.php
index 0b0fd53..a355f53 100644 (file)
@@ -45,6 +45,8 @@ use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
  * to automatically add or extend namespaces which then become
  * available in every Fluid template file without having to
  * register the namespace.
+ *
+ * @internal This is a helper class which is not considered part of TYPO3's Public API.
  */
 class ViewHelperResolver extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperResolver
 {
@@ -58,12 +60,11 @@ class ViewHelperResolver extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperRes
     public function __construct()
     {
         $this->namespaces = $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces'];
-        $configuration = $this->getBackendUser()->uc['TSFE_adminConfig'];
-        if (TYPO3_MODE === 'FE'
-            && isset($configuration['preview_showFluidDebug'])
-            && $configuration['preview_showFluidDebug']
-        ) {
-            $this->namespaces['f'][] = 'TYPO3\\CMS\\Fluid\\ViewHelpers\\Debug';
+        if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE && $this->getBackendUser() instanceof BackendUserAuthentication) {
+            $configuration = $this->getBackendUser()->uc['AdminPanel'];
+            if (isset($configuration['preview_showFluidDebug']) && $configuration['preview_showFluidDebug']) {
+                $this->namespaces['f'][] = 'TYPO3\\CMS\\Fluid\\ViewHelpers\\Debug';
+            }
         }
     }