‪TYPO3CMS  10.4
ViewHelperResolver.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
22 
52 class ‪ViewHelperResolver extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperResolver
53 {
61  public function ‪__construct()
62  {
63  $this->namespaces = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces'];
64  if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE && $this->‪getBackendUser() instanceof ‪BackendUserAuthentication) {
65  if ($this->‪getBackendUser()->uc['AdminPanel']['preview_showFluidDebug'] ?? false) {
66  $this->namespaces['f'][] = 'TYPO3\\CMS\\Fluid\\ViewHelpers\\Debug';
67  }
68  }
69  }
70 
75  public function ‪createViewHelperInstanceFromClassName($viewHelperClassName)
76  {
77  return $this->‪getObjectManager()->‪get($viewHelperClassName);
78  }
79 
83  protected function ‪getObjectManager()
84  {
85  return GeneralUtility::makeInstance(ObjectManager::class);
86  }
87 
91  protected function ‪getBackendUser()
92  {
93  return ‪$GLOBALS['BE_USER'];
94  }
95 }
‪TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver
Definition: ViewHelperResolver.php:53
‪TYPO3\CMS\Fluid\Core\ViewHelper
Definition: ViewHelperResolver.php:16
‪TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\getObjectManager
‪ObjectManagerInterface getObjectManager()
Definition: ViewHelperResolver.php:83
‪TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\getBackendUser
‪BackendUserAuthentication getBackendUser()
Definition: ViewHelperResolver.php:91
‪TYPO3\CMS\Extbase\Object\ObjectManagerInterface
Definition: ObjectManagerInterface.php:26
‪TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\__construct
‪__construct()
Definition: ViewHelperResolver.php:61
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\createViewHelperInstanceFromClassName
‪TYPO3Fluid Fluid Core ViewHelper ViewHelperInterface createViewHelperInstanceFromClassName($viewHelperClassName)
Definition: ViewHelperResolver.php:75
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:28
‪TYPO3\CMS\Extbase\Object\ObjectManagerInterface\get
‪object &T get(string $className,... $constructorArguments)