‪TYPO3CMS  9.5
ViewHelperResolver.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 
51 class ‪ViewHelperResolver extends \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperResolver
52 {
60  public function ‪__construct()
61  {
62  $this->namespaces = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces'];
63  if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE && $this->‪getBackendUser() instanceof ‪BackendUserAuthentication) {
64  $configuration = $this->‪getBackendUser()->uc['AdminPanel'];
65  if (isset($configuration['preview_showFluidDebug']) && $configuration['preview_showFluidDebug']) {
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\Extbase\Object\ObjectManagerInterface\get
‪object &T get($objectName,... $constructorArguments)
‪TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver
Definition: ViewHelperResolver.php:52
‪TYPO3\CMS\Fluid\Core\ViewHelper
Definition: ViewHelperResolver.php:2
‪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:23
‪TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\__construct
‪__construct()
Definition: ViewHelperResolver.php:60
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪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:45
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:25