TYPO3 CMS  TYPO3_6-2
HtmlViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is part of the TYPO3 project - inspiring people to share! *
6  * *
7  * TYPO3 is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU General Public License version 2 as published by *
9  * the Free Software Foundation. *
10  * *
11  * This script is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14  * Public License for more details. *
15  * */
48 
52  protected $contentObject;
53 
57  protected $tsfeBackup;
58 
66  protected $escapingInterceptorEnabled = FALSE;
67 
72 
77  public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
78  $this->configurationManager = $configurationManager;
79  $this->contentObject = $this->configurationManager->getContentObject();
80  }
81 
86  public function render($parseFuncTSPath = 'lib.parseFunc_RTE') {
87  if (TYPO3_MODE === 'BE') {
89  }
90  $value = $this->renderChildren();
91  $content = $this->contentObject->parseFunc($value, array(), '< ' . $parseFuncTSPath);
92  if (TYPO3_MODE === 'BE') {
93  $this->resetFrontendEnvironment();
94  }
95  return $content;
96  }
97 
104  protected function simulateFrontendEnvironment() {
105  $this->tsfeBackup = isset($GLOBALS['TSFE']) ? $GLOBALS['TSFE'] : NULL;
106  $GLOBALS['TSFE'] = new \stdClass();
107  $GLOBALS['TSFE']->tmpl = new \stdClass();
108  $GLOBALS['TSFE']->tmpl->setup = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
109  }
110 
117  protected function resetFrontendEnvironment() {
118  $GLOBALS['TSFE'] = $this->tsfeBackup;
119  }
120 }
render($parseFuncTSPath='lib.parseFunc_RTE')
const TYPO3_MODE
Definition: init.php:40
injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]