[CLEANUP] Rework/simplify copyright header and remove @package
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / Format / HtmlViewHelper.php
index e3b550e..9d8c431 100644 (file)
@@ -1,19 +1,17 @@
 <?php
+namespace TYPO3\CMS\Fluid\ViewHelpers\Format;
 
-/*                                                                        *
- * This script is part of the TYPO3 project - inspiring people to share!  *
- *                                                                        *
- * TYPO3 is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License version 2 as published by  *
- * the Free Software Foundation.                                          *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
- * Public License for more details.                                       *
- *                                                                        */
-
-/**
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
  */
 
 /**
  * </output>
  *
  * @see http://typo3.org/documentation/document-library/references/doc_core_tsref/4.2.0/view/1/5/#id4198758
- *
  */
-class Tx_Fluid_ViewHelpers_Format_HtmlViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+class HtmlViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
 
        /**
-        * @var tslib_cObj
+        * @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
         */
        protected $contentObject;
 
        /**
-        * @var t3lib_fe contains a backup of the current $GLOBALS['TSFE'] if used in BE mode
+        * @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController contains a backup of the current $GLOBALS['TSFE'] if used in BE mode
         */
        protected $tsfeBackup;
 
@@ -70,31 +67,29 @@ class Tx_Fluid_ViewHelpers_Format_HtmlViewHelper extends Tx_Fluid_Core_ViewHelpe
        protected $escapingInterceptorEnabled = FALSE;
 
        /**
-        * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
+        * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
         */
        protected $configurationManager;
 
        /**
-        * @param Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager
+        * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
         * @return void
         */
-       public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
+       public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
                $this->configurationManager = $configurationManager;
                $this->contentObject = $this->configurationManager->getContentObject();
        }
 
        /**
         * @param string $parseFuncTSPath path to TypoScript parseFunc setup.
-        * @return the parsed string.
+        * @return string the parsed string.
         */
        public function render($parseFuncTSPath = 'lib.parseFunc_RTE') {
                if (TYPO3_MODE === 'BE') {
                        $this->simulateFrontendEnvironment();
                }
-
                $value = $this->renderChildren();
                $content = $this->contentObject->parseFunc($value, array(), '< ' . $parseFuncTSPath);
-
                if (TYPO3_MODE === 'BE') {
                        $this->resetFrontendEnvironment();
                }
@@ -103,14 +98,15 @@ class Tx_Fluid_ViewHelpers_Format_HtmlViewHelper extends Tx_Fluid_Core_ViewHelpe
 
        /**
         * Copies the specified parseFunc configuration to $GLOBALS['TSFE']->tmpl->setup in Backend mode
-        * This somewhat hacky work around is currently needed because the parseFunc() function of tslib_cObj relies on those variables to be set
+        * This somewhat hacky work around is currently needed because the parseFunc() function of \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer relies on those variables to be set
         *
         * @return void
         */
        protected function simulateFrontendEnvironment() {
                $this->tsfeBackup = isset($GLOBALS['TSFE']) ? $GLOBALS['TSFE'] : NULL;
-               $GLOBALS['TSFE'] = new stdClass();
-               $GLOBALS['TSFE']->tmpl->setup = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
+               $GLOBALS['TSFE'] = new \stdClass();
+               $GLOBALS['TSFE']->tmpl = new \stdClass();
+               $GLOBALS['TSFE']->tmpl->setup = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
        }
 
        /**
@@ -123,5 +119,3 @@ class Tx_Fluid_ViewHelpers_Format_HtmlViewHelper extends Tx_Fluid_Core_ViewHelpe
                $GLOBALS['TSFE'] = $this->tsfeBackup;
        }
 }
-
-?>
\ No newline at end of file