[FEATURE] Fluid (TemplateView): Made templateRootPath configurable via TypoScript...
authorSebastian Kurfürst <sebastian@typo3.org>
Mon, 31 Aug 2009 11:20:14 +0000 (11:20 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Mon, 31 Aug 2009 11:20:14 +0000 (11:20 +0000)
typo3/sysext/extbase/Classes/Configuration/Manager.php
typo3/sysext/extbase/Classes/MVC/Controller/ActionController.php
typo3/sysext/extbase/Classes/Utility/Extension.php

index ee9dcc1..2ad6825 100644 (file)
@@ -128,6 +128,9 @@ class Tx_Extbase_Configuration_Manager {
                if (isset($pluginConfiguration['persistence'])) {
                        $pluginConfiguration = $this->resolveTyposcriptReference($pluginConfiguration, 'persistence');
                }
                if (isset($pluginConfiguration['persistence'])) {
                        $pluginConfiguration = $this->resolveTyposcriptReference($pluginConfiguration, 'persistence');
                }
+               if (isset($pluginConfiguration['view'])) {
+                       $pluginConfiguration = $this->resolveTyposcriptReference($pluginConfiguration, 'view');
+               }
                $frameworkConfiguration = t3lib_div::array_merge_recursive_overrule($frameworkConfiguration, Tx_Extbase_Utility_TypoScript::convertTypoScriptArrayToPlainArray($pluginConfiguration));
                return $frameworkConfiguration;
        }
                $frameworkConfiguration = t3lib_div::array_merge_recursive_overrule($frameworkConfiguration, Tx_Extbase_Utility_TypoScript::convertTypoScriptArrayToPlainArray($pluginConfiguration));
                return $frameworkConfiguration;
        }
index b01a264..2247a64 100644 (file)
@@ -255,6 +255,13 @@ class Tx_Extbase_MVC_Controller_ActionController extends Tx_Extbase_MVC_Controll
                $view = $this->objectManager->getObject('Tx_Fluid_View_TemplateView');
                $controllerContext = $this->buildControllerContext();
                $view->setControllerContext($controllerContext);
                $view = $this->objectManager->getObject('Tx_Fluid_View_TemplateView');
                $controllerContext = $this->buildControllerContext();
                $view->setControllerContext($controllerContext);
+               
+               // Template Path Override
+               $extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
+               if (isset($extbaseFrameworkConfiguration['view']['templateRootPath']) && $extbaseFrameworkConfiguration['view']['templateRootPath']) {
+                       $view->setTemplateRootPath($extbaseFrameworkConfiguration['view']['templateRootPath']);
+               }
+
                if ($view->hasTemplate() === FALSE) {
                        $viewObjectName = $this->resolveViewObjectName();
                        if (class_exists($viewObjectName) === FALSE) $viewObjectName = 'Tx_Extbase_MVC_View_EmptyView';
                if ($view->hasTemplate() === FALSE) {
                        $viewObjectName = $this->resolveViewObjectName();
                        if (class_exists($viewObjectName) === FALSE) $viewObjectName = 'Tx_Extbase_MVC_View_EmptyView';
index 6cffe62..c38ef1c 100644 (file)
@@ -121,7 +121,10 @@ plugin.tx_' . strtolower($extensionName) . '.persistence {
        # storagePid
        classes {
        }
        # storagePid
        classes {
        }
-}');
+}
+plugin.tx_' . strtolower($extensionName) . '.view {
+       templateRootPath = 
+}'             );
                t3lib_extMgm::addTypoScript($extensionName, 'setup', '
 # Setting ' . $extensionName . ' plugin TypoScript
 ' . $pluginTemplate);
                t3lib_extMgm::addTypoScript($extensionName, 'setup', '
 # Setting ' . $extensionName . ' plugin TypoScript
 ' . $pluginTemplate);
@@ -137,6 +140,7 @@ tt_content.list.20.' . $pluginSignature . ' {
        $switchableControllerActions . '
 
        persistence =< plugin.tx_' . strtolower($extensionName) . '.persistence
        $switchableControllerActions . '
 
        persistence =< plugin.tx_' . strtolower($extensionName) . '.persistence
+       view =< plugin.tx_' . strtolower($extensionName) . '.view
 }
 ' . $conditions);
 
 }
 ' . $conditions);