[!!!][TASK] Fluid: Raised version number to 1.1.0. This version needs Extbase 1...
authorSebastian Kurfürst <sebastian@typo3.org>
Tue, 16 Mar 2010 08:49:45 +0000 (08:49 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Tue, 16 Mar 2010 08:49:45 +0000 (08:49 +0000)
[TASK] Fluid: Backported all changes from Fluid v5 again. This includes mostly some internal restructurings.
[!!!][TASK] Fluid (ViewHelpers): The <f:base> ViewHelper now creates a self-closing tag instead of an opening/closing tag. This is standards-conformant, but will BREAK IE6!!

37 files changed:
typo3/sysext/fluid/Classes/Compatibility/ObjectFactory.php [deleted file]
typo3/sysext/fluid/Classes/Compatibility/ObjectManager.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/Compatibility/TemplateParserBuilder.php
typo3/sysext/fluid/Classes/Core/Parser/Configuration.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/Core/Parser/InterceptorInterface.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/AbstractNode.php
typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NodeInterface.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ObjectAccessorNode.php
typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/RootNode.php
typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/TextNode.php
typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ViewHelperNode.php
typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
typo3/sysext/fluid/Classes/Core/Rendering/HTMLSpecialCharsPostProcessor.php [deleted file]
typo3/sysext/fluid/Classes/Core/Rendering/ObjectAccessorPostProcessorInterface.php [deleted file]
typo3/sysext/fluid/Classes/Core/Rendering/RenderingConfiguration.php [deleted file]
typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php
typo3/sysext/fluid/Classes/Core/RuntimeException.php [deleted file]
typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
typo3/sysext/fluid/Classes/Core/ViewHelper/TagBasedViewHelper.php
typo3/sysext/fluid/Classes/Core/ViewHelper/TemplateVariableContainer.php
typo3/sysext/fluid/Classes/Service/DocbookGenerator.php
typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResource.php [deleted file]
typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResourceException.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/View/TemplateView.php
typo3/sysext/fluid/Classes/View/TemplateViewInterface.php
typo3/sysext/fluid/Classes/ViewHelpers/BaseViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/EscapeViewHelper.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/ViewHelpers/Form/SelectViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/TextboxViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/RenderFlashMessagesViewHelper.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/BaseViewHelperTest.php
typo3/sysext/fluid/ext_autoload.php
typo3/sysext/fluid/ext_emconf.php

diff --git a/typo3/sysext/fluid/Classes/Compatibility/ObjectFactory.php b/typo3/sysext/fluid/Classes/Compatibility/ObjectFactory.php
deleted file mode 100644 (file)
index 230aa03..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-/*                                                                        *
- * 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.                                       *
- *                                                                        */
-
-/**
- * @package
- * @subpackage
- * @version $Id$
- */
-/**
- * Class emulating the object factory for Fluid v4.
- *
- * DO NOT USE DIRECTLY!
- * @internal
- */
-class Tx_Fluid_Compatibility_ObjectFactory implements t3lib_Singleton {
-
-       protected $injectors = array(
-               'Tx_Fluid_ViewHelpers_Form_AbstractFormViewHelper' => array(
-                       'injectPersistenceManager' => 'Tx_Extbase_Persistence_Manager'
-               ),
-               'Tx_Fluid_Core_ViewHelper_AbstractViewHelper' => array(
-                       'injectReflectionService' => 'Tx_Extbase_Reflection_Service'
-               ),
-               'Tx_Fluid_Core_ViewHelper_TagBasedViewHelper' => array(
-                       'injectTagBuilder' => 'Tx_Fluid_Core_ViewHelper_TagBuilder'
-               ),
-               'Tx_Fluid_Core_Parser_ParsingState' => array(
-                       'injectVariableContainer' => 'Tx_Fluid_Core_ViewHelper_TemplateVariableContainer'
-               ),
-               'Tx_Fluid_Core_Parser_TemplateParser' => array(
-                       'injectObjectFactory' => 'Tx_Fluid_Compatibility_ObjectFactory'
-               ),
-               'Tx_Fluid_Core_Rendering_RenderingContext' => array(
-                       'injectObjectFactory' => 'Tx_Fluid_Compatibility_ObjectFactory'
-               ),
-               'Tx_Extbase_Validation_ValidatorResolver' => array(
-                       'injectObjectManager' => 'Tx_Extbase_Object_Manager'
-               ),
-               'Tx_Fluid_ViewHelpers_FormViewHelper' => array(
-                       'injectRequestHashService' => 'Tx_Extbase_Security_Channel_RequestHashService'
-               )
-       );
-
-       /**
-        * Create a certain object name
-        *
-        * DO NOT USE DIRECTLY!
-        *
-        * @param string $objectName Object name to create
-        * @retrun object Object which was created
-        * @internal
-        */
-       public function create($objectName) {
-               $constructorArguments = func_get_args();
-
-               $object = call_user_func_array(array('t3lib_div', 'makeInstance'), $constructorArguments);
-               $injectObjects = array();
-
-               if (isset($this->injectors[$objectName])) {
-                       $injectObjects = array_merge($injectObjects, $this->injectors[$objectName]);
-               }
-               foreach (class_parents($objectName) as $parentObjectName) {
-                       if (isset($this->injectors[$parentObjectName])) {
-                               $injectObjects = array_merge($injectObjects, $this->injectors[$parentObjectName]);
-                       }
-               }
-               foreach (class_implements($objectName) as $parentObjectName) {
-                       if (isset($this->injectors[$parentObjectName])) {
-                               $injectObjects = array_merge($injectObjects, $this->injectors[$parentObjectName]);
-                       }
-               }
-               foreach ($injectObjects as $injectMethodName => $injectObjectName) {
-                       call_user_func(array($object, $injectMethodName), $this->create($injectObjectName));
-               }
-               return $object;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Compatibility/ObjectManager.php b/typo3/sysext/fluid/Classes/Compatibility/ObjectManager.php
new file mode 100644 (file)
index 0000000..a6febc1
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+
+/*                                                                        *
+ * 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.                                       *
+ *                                                                        */
+
+/**
+ * @package
+ * @subpackage
+ * @version $Id: ObjectFactory.php 1734 2009-11-25 21:53:57Z stucki $
+ */
+/**
+ * Class emulating the object factory for Fluid v4.
+ *
+ * DO NOT USE DIRECTLY!
+ * @internal
+ */
+class Tx_Fluid_Compatibility_ObjectManager implements t3lib_Singleton {
+
+       protected $injectors = array(
+               'Tx_Fluid_ViewHelpers_Form_AbstractFormViewHelper' => array(
+                       'injectPersistenceManager' => 'Tx_Extbase_Persistence_Manager'
+               ),
+               'Tx_Fluid_Core_ViewHelper_AbstractViewHelper' => array(
+                       'injectReflectionService' => 'Tx_Extbase_Reflection_Service'
+               ),
+               'Tx_Fluid_Core_ViewHelper_TagBasedViewHelper' => array(
+                       'injectTagBuilder' => 'Tx_Fluid_Core_ViewHelper_TagBuilder'
+               ),
+               'Tx_Fluid_Core_Parser_ParsingState' => array(
+                       'injectVariableContainer' => 'Tx_Fluid_Core_ViewHelper_TemplateVariableContainer'
+               ),
+               'Tx_Fluid_Core_Parser_TemplateParser' => array(
+                       'injectObjectManager' => 'Tx_Fluid_Compatibility_ObjectManager'
+               ),
+               'Tx_Fluid_Core_Rendering_RenderingContext' => array(
+                       'injectObjectManager' => 'Tx_Fluid_Compatibility_ObjectManager'
+               ),
+               'Tx_Fluid_Core_Parser_Interceptor_Escape' => array(
+                       'injectObjectManager' => 'Tx_Fluid_Compatibility_ObjectManager'
+               ),
+               'Tx_Extbase_Validation_ValidatorResolver' => array(
+                       'injectObjectManager' => 'Tx_Extbase_Object_Manager'
+               ),
+               'Tx_Fluid_ViewHelpers_FormViewHelper' => array(
+                       'injectRequestHashService' => 'Tx_Extbase_Security_Channel_RequestHashService'
+               )
+       );
+
+       /**
+        * Create a certain object name
+        *
+        * DO NOT USE DIRECTLY!
+        *
+        * @param string $objectName Object name to create
+        * @return object Object which was created
+        * @internal
+        */
+       public function create($objectName) {
+               $constructorArguments = func_get_args();
+
+               $object = call_user_func_array(array('t3lib_div', 'makeInstance'), $constructorArguments);
+               $injectObjects = array();
+
+               if (isset($this->injectors[$objectName])) {
+                       $injectObjects = array_merge($injectObjects, $this->injectors[$objectName]);
+               }
+               foreach (class_parents($objectName) as $parentObjectName) {
+                       if (isset($this->injectors[$parentObjectName])) {
+                               $injectObjects = array_merge($injectObjects, $this->injectors[$parentObjectName]);
+                       }
+               }
+               foreach (class_implements($objectName) as $parentObjectName) {
+                       if (isset($this->injectors[$parentObjectName])) {
+                               $injectObjects = array_merge($injectObjects, $this->injectors[$parentObjectName]);
+                       }
+               }
+               foreach ($injectObjects as $injectMethodName => $injectObjectName) {
+                       call_user_func(array($object, $injectMethodName), $this->create($injectObjectName));
+               }
+               return $object;
+       }
+
+       public function get($objectName) {
+               return $this->create($objectName);
+       }
+}
+
+?>
\ No newline at end of file
index 82dcaab..9de22df 100644 (file)
@@ -32,7 +32,7 @@ class Tx_Fluid_Compatibility_TemplateParserBuilder {
         */
        static public function build() {
                $templateParser = t3lib_div::makeInstance('Tx_Fluid_Core_Parser_TemplateParser');
-               $templateParser->injectObjectFactory(t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectFactory'));
+               $templateParser->injectObjectManager(t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectManager'));
                return $templateParser;
        }
 }
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/Configuration.php b/typo3/sysext/fluid/Classes/Core/Parser/Configuration.php
new file mode 100644 (file)
index 0000000..deaf281
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * The parser configuration. Contains all configuration needed to configure
+ * the building of a SyntaxTree.
+ *
+ * @version $Id: Configuration.php 3952 2010-03-16 08:00:53Z sebastian $
+ * @package Fluid
+ * @subpackage Core\Parser
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @scope prototype
+ */
+class Tx_Fluid_Core_Parser_Configuration {
+
+       /**
+        * generic interceptors registered with the configuration.
+        * @var array<\SplObjectStorage>
+        */
+       protected $interceptors;
+
+       /**
+        * Set up the internals...
+        *
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function __construct() {
+               $this->interceptors = array();
+       }
+
+       /**
+        * Adds an interceptor to apply to values coming from object accessors.
+        *
+        * @param Tx_Fluid_Core_Parser_InterceptorInterface $interceptor
+        * @return void
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function addInterceptor(Tx_Fluid_Core_Parser_InterceptorInterface $interceptor) {
+               foreach ($interceptor->getInterceptionPoints() as $interceptionPoint) {
+                       if (!isset($this->interceptors[$interceptionPoint])) {
+                               $this->interceptors[$interceptionPoint] = new SplObjectStorage();
+                       }
+                       if (!$this->interceptors[$interceptionPoint]->contains($interceptor)) {
+                               $this->interceptors[$interceptionPoint]->attach($interceptor);
+                       }
+               }
+       }
+
+       /**
+        * Removes an interceptor to apply to values coming from object accessors.
+        *
+        * @param Tx_Fluid_Core_Parser_InterceptorInterface $interceptor
+        * @return void
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function removeInterceptor($interceptor) {
+               foreach ($interceptor->getInterceptionPoints() as $interceptionPoint) {
+                       if ($this->interceptors[$interceptionPoint]->contains($interceptor)) {
+                               $this->interceptors[$interceptionPoint]->detach($interceptor);
+                       }
+               }
+               
+       }
+
+       /**
+        * Returns all interceptors for a given Interception Point.
+        *
+        * @param int $inerceptionPoint one of the Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_* constants,
+        * @return \SplObjectStorage<Tx_Fluid_Core_Parser_InterceptorInterface>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function getInterceptors($interceptionPoint) {
+               if ($this->interceptors[$interceptionPoint] instanceof SplObjectStorage) {
+                       return $this->interceptors[$interceptionPoint];
+               }
+               return new SplObjectStorage();
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php b/typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php
new file mode 100644 (file)
index 0000000..1ded12a
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * An interceptor adding the escape viewhelper to the suitable places.
+ *
+ * @version $Id: Escape.php 3953 2010-03-16 08:08:17Z sebastian $
+ * @package Fluid
+ * @subpackage Core\Parser\Interceptor
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class Tx_Fluid_Core_Parser_Interceptor_Escape implements Tx_Fluid_Core_Parser_InterceptorInterface {
+
+       /**
+        * Is the interceptor enabled right now?
+        * @var boolean
+        */
+       protected $interceptorEnabled = TRUE;
+
+       /**
+        * A stack of ViewHelperNodes which currently disable the interceptor.
+        * Needed to enable the interceptor again.
+        * 
+        * @var array<Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface>
+        */
+       protected $viewHelperNodesWhichDisableTheInterceptor = array();
+       
+       /**
+        * Inject object factory
+        *
+        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @return void
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * Adds a ViewHelper node using the EscapeViewHelper to the given node.
+        * If "escapingInterceptorEnabled" in the ViewHelper is FALSE, will disable itself inside the ViewHelpers body.
+        *
+        * @param Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $node
+        * @param int One of the INTERCEPT_* constants for the current interception point
+        * @return Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        */
+       public function process(Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $node, $interceptorPosition) {
+               if ($interceptorPosition === Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER) {
+                       if (!$node->getViewHelper()->isEscapingInterceptorEnabled()) {
+                               $this->interceptorEnabled = FALSE;
+                               $this->viewHelperNodesWhichDisableTheInterceptor[] = $node;
+                       }
+               } elseif ($interceptorPosition === Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER) {
+                       if (end($this->viewHelperNodesWhichDisableTheInterceptor) === $node) {
+                               array_pop($this->viewHelperNodesWhichDisableTheInterceptor);
+                               if (count($this->viewHelperNodesWhichDisableTheInterceptor) === 0) {
+                                       $this->interceptorEnabled = TRUE;
+                               }
+                       }
+               } elseif ($this->interceptorEnabled && $node instanceof Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode) {
+                       $node = $this->objectManager->create(
+                               'Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode',
+                               $this->objectManager->create('Tx_Fluid_ViewHelpers_EscapeViewHelper'),
+                               array('value' => $node)
+                       );
+               }
+               return $node;
+       }
+
+       /**
+        * This interceptor wants to hook into object accessor creation, and opening / closing ViewHelpers.
+        *
+        * @return array Array of INTERCEPT_* constants
+        */
+       public function getInterceptionPoints() {
+               return array(
+                       Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER,
+                       Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER,
+                       Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_OBJECTACCESSOR
+               );
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/InterceptorInterface.php b/typo3/sysext/fluid/Classes/Core/Parser/InterceptorInterface.php
new file mode 100644 (file)
index 0000000..afd5eb7
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * An interceptor interface. Interceptors are used in the parsing stage to change
+ * the syntax tree of a template, e.g. by adding viewhelper nodes.
+ *
+ * @version $Id: InterceptorInterface.php 3952 2010-03-16 08:00:53Z sebastian $
+ * @package Fluid
+ * @subpackage Core\Parser
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+interface Tx_Fluid_Core_Parser_InterceptorInterface {
+
+       const INTERCEPT_OPENING_VIEWHELPER = 1;
+       const INTERCEPT_CLOSING_VIEWHELPER = 2;
+       const INTERCEPT_TEXT = 3;
+       const INTERCEPT_OBJECTACCESSOR = 4;
+
+       /**
+        * The interceptor can process the given node at will and must return a node
+        * that will be used in place of the given node.
+        *
+        * @param Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $node
+        * @param int One of the INTERCEPT_* constants for the current interception point
+        * @return Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface
+        */
+       public function process(Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $node, $interceptorPosition);
+
+       /**
+        * The interceptor should define at which interception positions it wants to be called.
+        *
+        * @return array Array of INTERCEPT_* constants
+        */
+       public function getInterceptionPoints();
+}
+?>
\ No newline at end of file
index ee53b5f..dd4fe16 100644 (file)
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  * @scope prototype
  */
-abstract class Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode {
+abstract class Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode implements Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface {
 
        /**
         * List of Child Nodes.
-        * @var array<Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode>
+        * @var array<Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface>
         */
        protected $childNodes = array();
 
@@ -55,7 +55,7 @@ abstract class Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode {
        /**
         * Evaluate all child nodes and return the evaluated results.
         *
-        * @return object Normally, an object is returned - in case it is concatenated with a string, a string is returned.
+        * @return mixed Normally, an object is returned - in case it is concatenated with a string, a string is returned.
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         * @author Bastian Waidelich <bastian@typo3.org>
         */
@@ -85,7 +85,7 @@ abstract class Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode {
         * Returns all child nodes for a given node.
         * This is especially needed to implement the boolean expression language.
         *
-        * @return array Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode A list of nodes
+        * @return array<Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface> A list of nodes
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function getChildNodes() {
@@ -95,22 +95,14 @@ abstract class Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode {
        /**
         * Appends a subnode to this node. Is used inside the parser to append children
         *
-        * @param Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode $childNode The subnode to add
+        * @param Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $childNode The subnode to add
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function addChildNode(Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode $childNode) {
+       public function addChildNode(Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $childNode) {
                $this->childNodes[] = $childNode;
        }
 
-       /**
-        * Evaluates the node - can return not only strings, but arbitary objects.
-        *
-        * @return object Evaluated node
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        * @author Bastian Waidelich <bastian@typo3.org>
-        */
-       abstract public function evaluate();
 }
 
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NodeInterface.php b/typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/NodeInterface.php
new file mode 100644 (file)
index 0000000..7eae719
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Node in the syntax tree.
+ *
+ * @version $Id: NodeInterface.php 3751 2010-01-22 15:56:47Z k-fish $
+ * @package Fluid
+ * @subpackage Core\Parser\SyntaxTree
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @scope prototype
+ */
+interface Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface {
+
+       /**
+        * @param Tx_Fluid_Core_Rendering_RenderingContext $renderingContext Rendering Context to be used for this evaluation
+        * @return void
+        */
+       public function setRenderingContext(Tx_Fluid_Core_Rendering_RenderingContext $renderingContext);
+
+       /**
+        * Evaluate all child nodes and return the evaluated results.
+        *
+        * @return mixed Normally, an object is returned - in case it is concatenated with a string, a string is returned.
+        */
+       public function evaluateChildNodes();
+
+       /**
+        * Returns all child nodes for a given node.
+        *
+        * @return array<Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface> A list of nodes
+        */
+       public function getChildNodes();
+
+       /**
+        * Appends a subnode to this node. Is used inside the parser to append children
+        *
+        * @param Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $childNode The subnode to add
+        * @return void
+        */
+       public function addChildNode(Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $childNode);
+
+       /**
+        * Evaluates the node - can return not only strings, but arbitary objects.
+        *
+        * @return mixed Evaluated node
+        */
+       public function evaluate();
+}
+
+?>
\ No newline at end of file
index 3d4b046..8ba7e89 100644 (file)
@@ -40,10 +40,8 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode extends Tx_Fluid_Core_P
        /**
         * Constructor. Takes an object path as input.
         *
-        * The first part of the object path has to be a variable in the TemplateVariableContainer.
-        * For the further parts, it is checked if the object has a getObjectname method. If yes, this is called.
-        * If no, it is checked if a property "objectname" exists.
-        * If no, an error is thrown.
+        * The first part of the object path has to be a variable in the
+        * TemplateVariableContainer.
         *
         * @param string $objectPath An Object Path, like object1.object2.object3
         * @author Sebastian Kurfürst <sebastian@typo3.org>
@@ -60,6 +58,9 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode extends Tx_Fluid_Core_P
         * - call public property, if exists
         * - fail
         *
+        * The first part of the object path has to be a variable in the
+        * TemplateVariableContainer.
+        *
         * @return object The evaluated object, can be any object type.
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         * @author Bastian Waidelich <bastian@typo3.org>
@@ -73,17 +74,10 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode extends Tx_Fluid_Core_P
                }
                $currentObject = $this->renderingContext->getTemplateVariableContainer()->get($variableName);
                if (count($objectPathParts) > 0) {
-                       $output = Tx_Extbase_Reflection_ObjectAccess::getPropertyPath($currentObject, implode('.', $objectPathParts));
+                       return Tx_Extbase_Reflection_ObjectAccess::getPropertyPath($currentObject, implode('.', $objectPathParts));
                } else {
-                       $output = $currentObject;
-               }
-
-               $postProcessor = $this->renderingContext->getRenderingConfiguration()->getObjectAccessorPostProcessor();
-               if ($postProcessor !== NULL) {
-                       $output = $postProcessor->process($output, $this->renderingContext->isObjectAccessorPostProcessorEnabled());
+                       return $currentObject;
                }
-
-               return $output;
        }
 }
 ?>
\ No newline at end of file
index 8b26291..5d8a140 100644 (file)
@@ -34,7 +34,7 @@ class Tx_Fluid_Core_Parser_SyntaxTree_RootNode extends Tx_Fluid_Core_Parser_Synt
        /**
         * Evaluate the root node, by evaluating the subtree.
         *
-        * @return object Evaluated subtree
+        * @return mixed Evaluated subtree
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function evaluate() {
index d28023a..29fe169 100644 (file)
@@ -51,13 +51,14 @@ class Tx_Fluid_Core_Parser_SyntaxTree_TextNode extends Tx_Fluid_Core_Parser_Synt
        }
 
        /**
-        * Return the text associated to the syntax tree.
+        * Return the text associated to the syntax tree. Text from child nodes is
+        * appended to the text in the node's own text.
         *
-        * @return string the text stored in this node.
+        * @return string the text stored in this node/subtree.
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function evaluate() {
-               return $this->text;
+               return $this->text . $this->evaluateChildNodes();
        }
 }
 
index 4597001..bd82b96 100644 (file)
@@ -32,7 +32,7 @@
 class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode {
 
        /**
-        * Namespace of view helper
+        * Class name of view helper
         * @var string
         */
        protected $viewHelperClassName;
@@ -44,17 +44,10 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
        protected $arguments = array();
 
        /**
-        * The cached ViewHelper, to make sure every SyntaxTreeNode has exactly one
-        * ViewHelper associated to it.
-        * @var Tx_Fluid_Core_ViewHelper_AbstractViewHelper
+        * The ViewHelper associated with this node
+        * @var Tx_Fluid_Core_ViewHelper_ViewHelperInterface
         */
-       protected $cachedViewHelper = NULL;
-
-       /**
-        * Cached argument definitions.
-        * @var array
-        */
-       protected $cachedArgumentDefinitions = NULL;
+       protected $viewHelper = NULL;
 
        /**
         * List of comparators which are supported in the boolean expression language.
@@ -84,13 +77,30 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
        /**
         * Constructor.
         *
-        * @param string $viewHelperClassName Fully qualified class name of the view helper
+        * @param Tx_Fluid_Core_ViewHelper_ViewHelperInterface $viewHelper The view helper
         * @param array $arguments Arguments of view helper - each value is a RootNode.
         * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Karsten Dambekalns <karsten@typo3.org>
         */
-       public function __construct($viewHelperClassName, array $arguments) {
-               $this->viewHelperClassName = $viewHelperClassName;
+       public function __construct(Tx_Fluid_Core_ViewHelper_ViewHelperInterface $viewHelper, array $arguments) {
+               $this->viewHelper = $viewHelper;
                $this->arguments = $arguments;
+
+               if (FALSE /*FIXME*/) {
+                       $this->viewHelperClassName = $this->viewHelper->FLOW3_AOP_Proxy_getProxyTargetClassName();
+               } else {
+                       $this->viewHelperClassName = get_class($this->viewHelper);
+               }
+       }
+
+       /**
+        * Returns the attached ViewHelper for this ViewHelperNode.
+        * We need this method because sometimes Interceptors need to ask some information from the ViewHelper.
+        *
+        * @return Tx_Fluid_Core_ViewHelper_AbstractViewHelper the attached ViewHelper, if it is initialized
+        */
+       public function getViewHelper() {
+               return $this->viewHelper;
        }
 
        /**
@@ -115,34 +125,26 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
         *
         * @return object evaluated node after the view helper has been called.
         * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        * @todo check recreation of viewhelper when revisiting caching
         */
        public function evaluate() {
                if ($this->renderingContext === NULL) {
                        throw new RuntimeException('RenderingContext is null in ViewHelperNode, but necessary. If this error appears, please report a bug!', 1242669031);
                }
 
-                       // Store if the ObjectAccessorPostProcessor has been enabled before this ViewHelper, because we need to re-enable it if needed after this ViewHelper
-               $hasObjectAccessorPostProcessorBeenEnabledBeforeThisViewHelper = $this->renderingContext->isObjectAccessorPostProcessorEnabled();
-
-                       // Caching of ViewHelper and Argument Definitions
-               $objectFactory = $this->renderingContext->getObjectFactory();
-               if ($this->cachedViewHelper !== NULL) {
-                       $viewHelper = $this->cachedViewHelper;
-                       $argumentDefinitions = $this->cachedArgumentDefinitions;
-               } else {
-                       $viewHelper = $objectFactory->create($this->viewHelperClassName);
-                       $argumentDefinitions = $viewHelper->prepareArguments();
+               $objectManager = $this->renderingContext->getObjectManager();
+               $contextVariables = $this->renderingContext->getTemplateVariableContainer()->getAllIdentifiers();
 
-                       $this->cachedViewHelper = $viewHelper;
-                       $this->cachedArgumentDefinitions = $argumentDefinitions;
+               if ($this->viewHelper === NULL) {
+                               // we have been resurrected from the cache
+                       $this->viewHelper = $objectManager->create($this->viewHelperClassName);
                }
-               $contextVariables = $this->renderingContext->getTemplateVariableContainer()->getAllIdentifiers();
 
                $evaluatedArguments = array();
                $renderMethodParameters = array();
-               $this->renderingContext->setObjectAccessorPostProcessorEnabled(FALSE);
-               if (count($argumentDefinitions)) {
-                       foreach ($argumentDefinitions as $argumentName => $argumentDefinition) {
+               if (count($this->viewHelper->prepareArguments())) {
+                       foreach ($this->viewHelper->prepareArguments() as $argumentName => $argumentDefinition) {
                                if (isset($this->arguments[$argumentName])) {
                                        $argumentValue = $this->arguments[$argumentName];
                                        $argumentValue->setRenderingContext($this->renderingContext);
@@ -156,32 +158,29 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
                        }
                }
 
-               $viewHelperArguments = $objectFactory->create('Tx_Fluid_Core_ViewHelper_Arguments', $evaluatedArguments);
-               $viewHelper->setArguments($viewHelperArguments);
-               $viewHelper->setTemplateVariableContainer($this->renderingContext->getTemplateVariableContainer());
+               $viewHelperArguments = $objectManager->create('Tx_Fluid_Core_ViewHelper_Arguments', $evaluatedArguments);
+               $this->viewHelper->setArguments($viewHelperArguments);
+               $this->viewHelper->setTemplateVariableContainer($this->renderingContext->getTemplateVariableContainer());
                if ($this->renderingContext->getControllerContext() !== NULL) {
-                       $viewHelper->setControllerContext($this->renderingContext->getControllerContext());
+                       $this->viewHelper->setControllerContext($this->renderingContext->getControllerContext());
                }
-               $viewHelper->setViewHelperVariableContainer($this->renderingContext->getViewHelperVariableContainer());
-               $viewHelper->setViewHelperNode($this);
+               $this->viewHelper->setViewHelperVariableContainer($this->renderingContext->getViewHelperVariableContainer());
+               $this->viewHelper->setViewHelperNode($this);
 
-               if ($viewHelper instanceof Tx_Fluid_Core_ViewHelper_Facets_ChildNodeAccessInterface) {
-                       $viewHelper->setChildNodes($this->childNodes);
-                       $viewHelper->setRenderingContext($this->renderingContext);
+               if ($this->viewHelper instanceof Tx_Fluid_Core_ViewHelper_Facets_ChildNodeAccessInterface) {
+                       $this->viewHelper->setChildNodes($this->childNodes);
+                       $this->viewHelper->setRenderingContext($this->renderingContext);
                }
 
-               $viewHelper->validateArguments();
-               $this->renderingContext->setObjectAccessorPostProcessorEnabled($viewHelper->isObjectAccessorPostProcessorEnabled());
-               $viewHelper->initialize();
+               $this->viewHelper->validateArguments();
+               $this->viewHelper->initialize();
                try {
-                       $output = call_user_func_array(array($viewHelper, 'render'), $renderMethodParameters);
+                       $output = call_user_func_array(array($this->viewHelper, 'render'), $renderMethodParameters);
                } catch (Tx_Fluid_Core_ViewHelper_Exception $exception) {
-                       // @todo [BW] rethrow exception, log, ignore.. depending on the current context
+                               // @todo [BW] rethrow exception, log, ignore.. depending on the current context
                        $output = $exception->getMessage();
                }
 
-               $this->renderingContext->setObjectAccessorPostProcessorEnabled($hasObjectAccessorPostProcessorBeenEnabledBeforeThisViewHelper);
-
                if ($contextVariables != $this->renderingContext->getTemplateVariableContainer()->getAllIdentifiers()) {
                        $endContextVariables = $this->renderingContext->getTemplateVariableContainer();
                        $diff = array_intersect($endContextVariables, $contextVariables);
@@ -247,11 +246,12 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
 
                        if ($childNode instanceof Tx_Fluid_Core_Parser_SyntaxTree_TextNode && !preg_match(str_replace('COMPARATORS', implode('|', self::$comparators), self::$booleanExpressionTextNodeCheckerRegularExpression), $childNode->evaluate())) {
                                $comparator = NULL;
-                               break; // skip loop and fall back to classical to boolean conversion.
+                                       // skip loop and fall back to classical to boolean conversion.
+                               break;
                        }
 
                        if ($comparator !== NULL) {
-                               // comparator already set, we are evaluating the right side of the comparator
+                                       // comparator already set, we are evaluating the right side of the comparator
                                if ($rightSide === NULL) {
                                        $rightSide = $childNode->evaluate();
                                } else {
@@ -259,7 +259,7 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
                                }
                        } elseif ($childNode instanceof Tx_Fluid_Core_Parser_SyntaxTree_TextNode
                                && ($comparator = $this->getComparatorFromString($childNode->evaluate()))) {
-                               // comparator in current string segment
+                                       // comparator in current string segment
                                $explodedString = explode($comparator, $childNode->evaluate());
                                if (isset($explodedString[0]) && trim($explodedString[0]) !== '') {
                                        $leftSide .= trim($explodedString[0]);
@@ -268,7 +268,7 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
                                        $rightSide .= trim($explodedString[1]);
                                }
                        } else {
-                               // comparator not found yet, on the left side of the comparator
+                                       // comparator not found yet, on the left side of the comparator
                                if ($leftSide === NULL) {
                                        $leftSide = $childNode->evaluate();
                                } else {
@@ -313,7 +313,7 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
                        case '<=':
                                return ($leftSide <= $rightSide);
                        default:
-                               throw new RuntimeException('Comparator "' . $comparator . '" was not implemented. Please report a bug.', 1244234398);
+                               throw new RuntimeException('Comparator "' . $comparator . '" was not implemented.', 1244234398);
                }
        }
 
@@ -339,7 +339,7 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
         * Convert argument strings to their equivalents. Needed to handle strings with a boolean meaning.
         *
         * @param mixed $value Value to be converted to boolean
-        * @return mixed New value
+        * @return boolean
         * @author Bastian Waidelich <bastian@typo3.org>
         * @todo this should be moved to another class
         */
@@ -348,7 +348,7 @@ class Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode extends Tx_Fluid_Core_Parse
                        return $value;
                }
                if (is_string($value)) {
-                       return (strtolower($value) !== 'false' && !empty($value));
+                       return (!empty($value) && strtolower($value) !== 'false');
                }
                if (is_numeric($value)) {
                        return $value > 0;
index 15987a5..9ed1395 100644 (file)
@@ -78,7 +78,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         *
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public static $SPLIT_PATTERN_TAGARGUMENTS = '/(?:\s*(?P<Argument>[a-zA-Z0-9:]+)=(?:"(?P<ValueDoubleQuoted>(?:\\\"|[^"])*)"|\'(?P<ValueSingleQuoted>(?:\\\\\'|[^\'])*)\')\s*)/';
+       public static $SPLIT_PATTERN_TAGARGUMENTS = '/(?:\s*(?P<Argument>[a-zA-Z0-9:]+)=(?:(?P<ValueQuoted>(?:"(?:\\\"|[^"])*")|(?:\'(?:\\\\\'|[^\'])*\')))\s*)/';
 
        /**
         * This pattern detects CDATA sections and outputs the text between opening
@@ -119,7 +119,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         */
        public static $SCAN_PATTERN_SHORTHANDSYNTAX_OBJECTACCESSORS = '/
                ^{                                                      # Start of shorthand syntax
-                                                                        # A shorthand syntax is either...
+                                                                       # A shorthand syntax is either...
                        (?P<Object>[a-zA-Z0-9\-_.]*)                                     # ... an object accessor
                        \s*(?P<Delimiter>(?:->)?)\s*
 
@@ -158,7 +158,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         */
        public static $SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER = '/
 
-               (?P<NamespaceIdentifier>[a-zA-Z0-9]+)                               # Namespace prefix of ViewHelper (as in $SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG)
+               (?P<NamespaceIdentifier>[a-zA-Z0-9]+)       # Namespace prefix of ViewHelper (as in $SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG)
                :
                (?P<MethodIdentifier>[a-zA-Z0-9\\.]+)
                \(                                          # Opening parameter brackets of ViewHelper
@@ -217,8 +217,10 @@ class Tx_Fluid_Core_Parser_TemplateParser {
                        (?P<Key>[a-zA-Z0-9\-_]+)                               # The keys of the array
                        \s*:\s*                                                   # Key|Value delimiter :
                        (?:                                                       # Possible value options:
-                               "(?P<DoubleQuotedString>(?:\\\"|[^"])*)"              # Double qouoted string
-                               |\'(?P<SingleQuotedString>(?:\\\\\'|[^\'])*)\'        # Single quoted string
+                               (?P<QuotedString>                                     # Quoted string
+                                       (?:"(?:\\\"|[^"])*")
+                                       |(?:\'(?:\\\\\'|[^\'])*\')
+                               )
                                |(?P<VariableIdentifier>[a-zA-Z][a-zA-Z0-9\-_.]*)    # variable identifiers have to start with a letter
                                |(?P<Number>[0-9.]+)                                  # Number
                                |{\s*(?P<Subarray>(?:(?P>ArrayPart)\s*,?\s*)+)\s*}              # Another sub-array
@@ -235,9 +237,14 @@ class Tx_Fluid_Core_Parser_TemplateParser {
        );
 
        /**
-        * @var \Tx_Fluid_Compatibility_ObjectFactory
+        * @var \Tx_Fluid_Compatibility_ObjectManager
         */
-       protected $objectFactory;
+       protected $objectManager;
+
+       /**
+        * @var Tx_Fluid_Core_Parser_Configuration
+        */
+       protected $configuration;
 
        /**
         * Constructor. Preprocesses the $SCAN_PATTERN_NAMESPACEDECLARATION by
@@ -252,12 +259,23 @@ class Tx_Fluid_Core_Parser_TemplateParser {
        /**
         * Inject object factory
         *
-        * @param Tx_Fluid_Compatibility_ObjectFactory $objectFactory
+        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function injectObjectFactory(Tx_Fluid_Compatibility_ObjectFactory $objectFactory) {
-               $this->objectFactory = $objectFactory;
+       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * Set the configuration for the parser.
+        *h
+        * @param Tx_Fluid_Core_Parser_Configuration $configuration
+        * @return void
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function setConfiguration(Tx_Fluid_Core_Parser_Configuration $configuration = NULL) {
+               $this->configuration = $configuration;
        }
 
        /**
@@ -271,11 +289,11 @@ class Tx_Fluid_Core_Parser_TemplateParser {
        public function parse($templateString) {
                if (!is_string($templateString)) throw new Tx_Fluid_Core_Parser_Exception('Parse requires a template string as argument, ' . gettype($templateString) . ' given.', 1224237899);
 
-               $this->initialize();
+               $this->reset();
 
                $templateString = $this->extractNamespaceDefinitions($templateString);
-               $splittedTemplate = $this->splitTemplateAtDynamicTags($templateString);
-               $parsingState = $this->buildMainObjectTree($splittedTemplate);
+               $splitTemplate = $this->splitTemplateAtDynamicTags($templateString);
+               $parsingState = $this->buildObjectTree($splitTemplate);
 
                return $parsingState;
        }
@@ -296,7 +314,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       protected function initialize() {
+       protected function reset() {
                $this->namespaces = array(
                        'f' => 'Tx_Fluid_ViewHelpers'
                );
@@ -340,37 +358,29 @@ class Tx_Fluid_Core_Parser_TemplateParser {
        }
 
        /**
-        * Build object tree from the splitted template
+        * Build object tree from the split template
         *
-        * @param array $splittedTemplate The splitted template, so that every tag with a namespace declaration is already a seperate array element.
+        * @param array $splitTemplate The split template, so that every tag with a namespace declaration is already a seperate array element.
         * @return Tx_Fluid_Core_Parser_ParsingState
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       protected function buildMainObjectTree($splittedTemplate) {
+       protected function buildObjectTree($splitTemplate) {
                $regularExpression_openingViewHelperTag = $this->prepareTemplateRegularExpression(self::$SCAN_PATTERN_TEMPLATE_VIEWHELPERTAG);
                $regularExpression_closingViewHelperTag = $this->prepareTemplateRegularExpression(self::$SCAN_PATTERN_TEMPLATE_CLOSINGVIEWHELPERTAG);
 
-               $state = $this->objectFactory->create('Tx_Fluid_Core_Parser_ParsingState');
-               $rootNode = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_RootNode');
+               $state = $this->objectManager->create('Tx_Fluid_Core_Parser_ParsingState');
+               $rootNode = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_RootNode');
                $state->setRootNode($rootNode);
                $state->pushNodeToStack($rootNode);
 
-               foreach ($splittedTemplate as $templateElement) {
+               foreach ($splitTemplate as $templateElement) {
                        $matchedVariables = array();
                        if (preg_match(self::$SCAN_PATTERN_CDATA, $templateElement, $matchedVariables) > 0) {
                                $this->textHandler($state, $matchedVariables[1]);
                        } elseif (preg_match($regularExpression_openingViewHelperTag, $templateElement, $matchedVariables) > 0) {
-                               $namespaceIdentifier = $matchedVariables['NamespaceIdentifier'];
-                               $methodIdentifier = $matchedVariables['MethodIdentifier'];
-                               $selfclosing = $matchedVariables['Selfclosing'] === '' ? FALSE : TRUE;
-                               $arguments = $matchedVariables['Attributes'];
-
-                               $this->openingViewHelperTagHandler($state, $namespaceIdentifier, $methodIdentifier, $arguments, $selfclosing);
+                               $this->openingViewHelperTagHandler($state, $matchedVariables['NamespaceIdentifier'], $matchedVariables['MethodIdentifier'], $matchedVariables['Attributes'], ($matchedVariables['Selfclosing'] === '' ? FALSE : TRUE));
                        } elseif (preg_match($regularExpression_closingViewHelperTag, $templateElement, $matchedVariables) > 0) {
-                               $namespaceIdentifier = $matchedVariables['NamespaceIdentifier'];
-                               $methodIdentifier = $matchedVariables['MethodIdentifier'];
-
-                               $this->closingViewHelperTagHandler($state, $namespaceIdentifier, $methodIdentifier);
+                               $this->closingViewHelperTagHandler($state, $matchedVariables['NamespaceIdentifier'], $matchedVariables['MethodIdentifier']);
                        } else {
                                $this->textAndShorthandSyntaxHandler($state, $templateElement);
                        }
@@ -398,7 +408,8 @@ class Tx_Fluid_Core_Parser_TemplateParser {
                $this->initializeViewHelperAndAddItToStack($state, $namespaceIdentifier, $methodIdentifier, $argumentsObjectTree);
 
                if ($selfclosing) {
-                       $state->popNodeFromStack();
+                       $node = $state->popNodeFromStack();
+                       $this->callInterceptor($node, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER);
                }
        }
 
@@ -412,37 +423,39 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         * @param array $argumentsObjectTree Arguments object tree
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Karsten Dambekalns <karsten@typo3.org>
         */
        protected function initializeViewHelperAndAddItToStack(Tx_Fluid_Core_Parser_ParsingState $state, $namespaceIdentifier, $methodIdentifier, $argumentsObjectTree) {
                if (!array_key_exists($namespaceIdentifier, $this->namespaces)) {
                        throw new Tx_Fluid_Core_Parser_Exception('Namespace could not be resolved. This exception should never be thrown!', 1224254792);
                }
 
-               $viewHelperName = $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier);
-
-               $viewHelper = $this->objectFactory->create($viewHelperName);
+               $viewHelper = $this->objectManager->create($this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier));
                $expectedViewHelperArguments = $viewHelper->prepareArguments();
                $this->abortIfUnregisteredArgumentsExist($expectedViewHelperArguments, $argumentsObjectTree);
                $this->abortIfRequiredArgumentsAreMissing($expectedViewHelperArguments, $argumentsObjectTree);
 
-               $currentDynamicNode = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode', $viewHelperName, $argumentsObjectTree);
+               $currentDynamicNode = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode', $viewHelper, $argumentsObjectTree);
 
                $state->getNodeFromStack()->addChildNode($currentDynamicNode);
 
                        // PostParse Facet
-               if (in_array('Tx_Fluid_Core_ViewHelper_Facets_PostParseInterface', class_implements($viewHelperName))) {
-                       call_user_func(array($viewHelperName, 'postParseEvent'), $currentDynamicNode, $argumentsObjectTree, $state->getVariableContainer());
+               if ($viewHelper instanceof Tx_Fluid_Core_ViewHelper_Facets_PostParseInterface) {
+                       $viewHelper::postParseEvent($currentDynamicNode, $argumentsObjectTree, $state->getVariableContainer());
                }
 
+               $this->callInterceptor($currentDynamicNode, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER);
+
                $state->pushNodeToStack($currentDynamicNode);
        }
 
        /**
-        * Throw a ParsingException if there are arguments which were not registered
+        * Throw an exception if there are arguments which were not registered
         * before.
         *
         * @param array $expectedArguments Array of Tx_Fluid_Core_ViewHelper_ArgumentDefinition of all expected arguments
         * @param array $actualArguments Actual arguments
+        * @throws Tx_Fluid_Core_Parser_Exception
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        protected function abortIfUnregisteredArgumentsExist($expectedArguments, $actualArguments) {
@@ -459,10 +472,11 @@ class Tx_Fluid_Core_Parser_TemplateParser {
        }
 
        /**
-        * Throw a ParsingException if required arguments are missing
+        * Throw an exception if required arguments are missing
         *
         * @param array $expectedArguments Array of Tx_Fluid_Core_ViewHelper_ArgumentDefinition of all expected arguments
         * @param array $actualArguments Actual arguments
+        * @throws Tx_Fluid_Core_Parser_Exception
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        protected function abortIfRequiredArgumentsAreMissing($expectedArguments, $actualArguments) {
@@ -475,11 +489,11 @@ class Tx_Fluid_Core_Parser_TemplateParser {
        }
 
        /**
-        * Resolve a view helper.
+        * Resolve a viewhelper name.
         *
         * @param string $namespaceIdentifier Namespace identifier for the view helper.
         * @param string $methodIdentifier Method identifier, might be hierarchical like "link.url"
-        * @return array An Array where the first argument is the object to call the method on, and the second argument is the method name
+        * @return string The fully qualified class name of the viewhelper
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        protected function resolveViewHelperName($namespaceIdentifier, $methodIdentifier) {
@@ -504,6 +518,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         * @param string $namespaceIdentifier Namespace identifier for the closing tag.
         * @param string $methodIdentifier Method identifier.
         * @return void
+        * @throws Tx_Fluid_Core_Parser_Exception
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        protected function closingViewHelperTagHandler(Tx_Fluid_Core_Parser_ParsingState $state, $namespaceIdentifier, $methodIdentifier) {
@@ -517,6 +532,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
                if ($lastStackElement->getViewHelperClassName() != $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier)) {
                        throw new Tx_Fluid_Core_Parser_Exception('Templating tags not properly nested. Expected: ' . $lastStackElement->getViewHelperClassName() . '; Actual: ' . $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier), 1224485398);
                }
+               $this->callInterceptor($lastStackElement, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER);
        }
 
        /**
@@ -527,6 +543,9 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         *
         * @param Tx_Fluid_Core_Parser_ParsingState $state The current parsing state
         * @param string $objectAccessorString String which identifies which objects to fetch
+        * @param string $delimiter
+        * @param string $viewHelperString
+        * @param string $additionalViewHelpersString
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
@@ -545,36 +564,61 @@ class Tx_Fluid_Core_Parser_TemplateParser {
                $matches = array();
                if (strlen($viewHelperString) > 0 && preg_match_all(self::$SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER, $viewHelperString, $matches, PREG_SET_ORDER) > 0) {
                                // The last ViewHelper has to be added first for correct chaining.
-                       $matches = array_reverse($matches);
-                       foreach ($matches as $singleMatch) {
-                               $namespaceIdentifier = $singleMatch['NamespaceIdentifier'];
-                               $methodIdentifier = $singleMatch['MethodIdentifier'];
+                       foreach (array_reverse($matches) as $singleMatch) {
                                if (strlen($singleMatch['ViewHelperArguments']) > 0) {
-                                       $arguments = $this->recursiveArrayHandler($singleMatch['ViewHelperArguments']);
-                                       $arguments = $this->postProcessArgumentsForObjectAccessor($arguments);
+                                       $arguments = $this->postProcessArgumentsForObjectAccessor(
+                                               $this->recursiveArrayHandler($singleMatch['ViewHelperArguments'])
+                                       );
                                } else {
                                        $arguments = array();
                                }
-                               $this->initializeViewHelperAndAddItToStack($state, $namespaceIdentifier, $methodIdentifier, $arguments);
+                               $this->initializeViewHelperAndAddItToStack($state, $singleMatch['NamespaceIdentifier'], $singleMatch['MethodIdentifier'], $arguments);
                                $numberOfViewHelpers++;
                        }
                }
 
                        // Object Accessor
                if (strlen($objectAccessorString) > 0) {
-                       $node = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', $objectAccessorString);
+                       
+                       $node = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', $objectAccessorString);
+                       $this->callInterceptor($node, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_OBJECTACCESSOR);
+
                        $state->getNodeFromStack()->addChildNode($node);
                }
 
                        // Close ViewHelper Tags if needed.
                for ($i=0; $i<$numberOfViewHelpers; $i++) {
-                       $state->popNodeFromStack();
+                       $node = $state->popNodeFromStack();
+                       $this->callInterceptor($node, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER);
+               }
+       }
+
+       /**
+        * Call all interceptors registered for a given interception point.
+        *
+        * @param Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface $node The syntax tree node which can be modified by the interceptors.
+        * @param int the interception point. One of the Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_* constants.
+        * @return void
+        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        */
+       protected function callInterceptor(Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface &$node, $interceptionPoint) {
+               if ($this->configuration !== NULL) {
+                       // $this->configuration is UNSET inside the arguments of a ViewHelper.
+                       // That's why the interceptors are only called if the object accesor is not inside a ViewHelper Argument
+                       // This could be a problem if We have a ViewHelper as an argument to another ViewHelper, and an ObjectAccessor nested inside there.
+                       // TODO: Clean up this.
+                       $interceptors = $this->configuration->getInterceptors($interceptionPoint);
+                       if (count($interceptors) > 0) {
+                               foreach($interceptors as $interceptor) {
+                                       $node = $interceptor->process($node, $interceptionPoint);
+                               }
+                       }
                }
        }
 
        /**
         * Post process the arguments for the ViewHelpers in the object accessor
-        * syntax. We need to convert an array into an array of ViewHelper Nodes
+        * syntax. We need to convert an array into an array of (only) nodes
         *
         * @param array $arguments The arguments to be processed
         * @return array the processed array
@@ -584,7 +628,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
        protected function postProcessArgumentsForObjectAccessor(array $arguments) {
                foreach ($arguments as $argumentName => $argumentValue) {
                        if (!($argumentValue instanceof Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode)) {
-                               $arguments[$argumentName] = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', (string)$argumentValue);
+                               $arguments[$argumentName] = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', (string)$argumentValue);
                        }
                }
                return $arguments;
@@ -604,14 +648,14 @@ class Tx_Fluid_Core_Parser_TemplateParser {
                $argumentsObjectTree = array();
                $matches = array();
                if (preg_match_all(self::$SPLIT_PATTERN_TAGARGUMENTS, $argumentsString, $matches, PREG_SET_ORDER) > 0) {
+                       $configurationBackup = $this->configuration;
+                       $this->configuration = NULL;
                        foreach ($matches as $singleMatch) {
                                $argument = $singleMatch['Argument'];
-                               if (!array_key_exists('ValueSingleQuoted', $singleMatch)) $singleMatch['ValueSingleQuoted'] = '';
-                               if (!array_key_exists('ValueDoubleQuoted', $singleMatch)) $singleMatch['ValueDoubleQuoted'] = '';
-
-                               $value = $this->unquoteArgumentString($singleMatch['ValueSingleQuoted'], $singleMatch['ValueDoubleQuoted']);
+                               $value = $this->unquoteString($singleMatch['ValueQuoted']);
                                $argumentsObjectTree[$argument] = $this->buildArgumentObjectTree($value);
                        }
+                       $this->configuration = $configurationBackup;
                }
                return $argumentsObjectTree;
        }
@@ -629,32 +673,32 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         */
        protected function buildArgumentObjectTree($argumentString) {
                if (strstr($argumentString, '{') === FALSE && strstr($argumentString, '<') === FALSE) {
-                       return $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', $argumentString);
+                       return $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', $argumentString);
                }
-               $splittedArgument = $this->splitTemplateAtDynamicTags($argumentString);
-               $rootNode = $this->buildMainObjectTree($splittedArgument)->getRootNode();
+               $splitArgument = $this->splitTemplateAtDynamicTags($argumentString);
+               $rootNode = $this->buildObjectTree($splitArgument)->getRootNode();
                return $rootNode;
        }
 
        /**
-        * Removes escapings from a given argument string. Expects two string
-        * parameters, with one of them being empty.
-        * The first parameter should be non-empty if the argument was quoted by
-        * single quotes, and the second parameter should be non-empty if the
-        * argument was quoted by double quotes.
+        * Removes escapings from a given argument string and trims the outermost
+        * quotes.
         *
         * This method is meant as a helper for regular expression results.
         *
-        * @param string $singleQuotedValue Value, if quoted by single quotes
-        * @param string $doubleQuotedValue Value, if quoted by double quotes
+        * @param string $quotedValue Value to unquote
         * @return string Unquoted value
         * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Karsten Dambekalns <karsten@typo3.org>
         */
-       protected function unquoteArgumentString($singleQuotedValue, $doubleQuotedValue) {
-               if ($singleQuotedValue != '') {
-                       $value = str_replace("\\'", "'", $singleQuotedValue);
-               } else {
-                       $value = str_replace('\"', '"', $doubleQuotedValue);
+       protected function unquoteString($quotedValue) {
+               switch ($quotedValue[0]) {
+                       case '"':
+                               $value = str_replace('\"', '"', trim($quotedValue, '"'));
+                       break;
+                       case "'":
+                               $value = str_replace("\'", "'", trim($quotedValue, "'"));
+                       break;
                }
                return str_replace('\\\\', '\\', $value);
        }
@@ -707,8 +751,9 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        protected function arrayHandler(Tx_Fluid_Core_Parser_ParsingState $state, $arrayText) {
-               $node = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_ArrayNode', $this->recursiveArrayHandler($arrayText));
-               $state->getNodeFromStack()->addChildNode($node);
+               $state->getNodeFromStack()->addChildNode(
+                       $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_ArrayNode', $this->recursiveArrayHandler($arrayText))
+               );
        }
 
        /**
@@ -732,17 +777,14 @@ class Tx_Fluid_Core_Parser_TemplateParser {
                        foreach ($matches as $singleMatch) {
                                $arrayKey = $singleMatch['Key'];
                                if (!empty($singleMatch['VariableIdentifier'])) {
-                                       $arrayToBuild[$arrayKey] = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', $singleMatch['VariableIdentifier']);
+                                       $arrayToBuild[$arrayKey] = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', $singleMatch['VariableIdentifier']);
                                } elseif (array_key_exists('Number', $singleMatch) && ( !empty($singleMatch['Number']) || $singleMatch['Number'] === '0' ) ) {
                                        $arrayToBuild[$arrayKey] = floatval($singleMatch['Number']);
-                               } elseif ( ( array_key_exists('DoubleQuotedString', $singleMatch) && !empty($singleMatch['DoubleQuotedString']) )
-                                                       || ( array_key_exists('SingleQuotedString', $singleMatch) && !empty($singleMatch['SingleQuotedString']) ) ) {
-                                       if (!array_key_exists('SingleQuotedString', $singleMatch)) $singleMatch['SingleQuotedString'] = '';
-                                       if (!array_key_exists('DoubleQuotedString', $singleMatch)) $singleMatch['DoubleQuotedString'] = '';
-                                       $argumentString = $this->unquoteArgumentString($singleMatch['SingleQuotedString'], $singleMatch['DoubleQuotedString']);
+                               } elseif ( ( array_key_exists('QuotedString', $singleMatch) && !empty($singleMatch['QuotedString']) ) ) {
+                                       $argumentString = $this->unquoteString($singleMatch['QuotedString']);
                                        $arrayToBuild[$arrayKey] = $this->buildArgumentObjectTree($argumentString);
                                } elseif ( array_key_exists('Subarray', $singleMatch) && !empty($singleMatch['Subarray'])) {
-                                       $arrayToBuild[$arrayKey] = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_ArrayNode', $this->recursiveArrayHandler($singleMatch['Subarray']));
+                                       $arrayToBuild[$arrayKey] = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_ArrayNode', $this->recursiveArrayHandler($singleMatch['Subarray']));
                                } else {
                                        throw new Tx_Fluid_Core_Parser_Exception('This exception should never be thrown, as the array value has to be of some type (Value given: "' . var_export($singleMatch, TRUE) . '"). Please post your template to the bugtracker at forge.typo3.org.', 1225136013);
                                }
@@ -760,10 +802,14 @@ class Tx_Fluid_Core_Parser_TemplateParser {
         * @param string $text
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Karsten Dambekalns <karsten@typo3.org>
         */
        protected function textHandler(Tx_Fluid_Core_Parser_ParsingState $state, $text) {
-               $node = $this->objectFactory->create('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', $text);
+               $node = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', $text);
+               $this->callInterceptor($node, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_TEXT);
+               
                $state->getNodeFromStack()->addChildNode($node);
        }
+
 }
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Core/Rendering/HTMLSpecialCharsPostProcessor.php b/typo3/sysext/fluid/Classes/Core/Rendering/HTMLSpecialCharsPostProcessor.php
deleted file mode 100644 (file)
index bc9ff43..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-
-/*                                                                        *
- * This script belongs to the FLOW3 package "Fluid".                      *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * 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 Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- *
- *
- * @version $Id$
- * @package Fluid
- * @subpackage Core\Rendering
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- * @scope prototype
- */
-class Tx_Fluid_Core_Rendering_HtmlSpecialCharsPostProcessor implements Tx_Fluid_Core_Rendering_ObjectAccessorPostProcessorInterface {
-
-       /**
-        * Process an Object Accessor by wrapping it into HTML.
-        * NOT part of public API.
-        *
-        * @param mixed $object the object that is currently rendered
-        * @param boolean $enabled TRUE if post processing is currently enabled.
-        * @return mixed $object the original object. If not within arguments and of type string, the value is htmlspecialchar'ed
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        * @author Bastian Waidelich <bastian@typo3.org>
-        */
-       public function process($object, $enabled) {
-               if ($enabled === TRUE && is_string($object)) {
-                       return htmlspecialchars($object);
-               }
-               return $object;
-       }
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Core/Rendering/ObjectAccessorPostProcessorInterface.php b/typo3/sysext/fluid/Classes/Core/Rendering/ObjectAccessorPostProcessorInterface.php
deleted file mode 100644 (file)
index 8857870..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-/*                                                                        *
- * This script belongs to the FLOW3 package "Fluid".                      *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * 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 Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- *
- *
- * @version $Id$
- * @package Fluid
- * @subpackage Core\Rendering
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-interface Tx_Fluid_Core_Rendering_ObjectAccessorPostProcessorInterface {
-
-       /**
-        * Post-Process an Object Accessor
-        *
-        * @param mixed $object the object that is currently rendered
-        * @param boolean $enabled TRUE if post processing is currently enabled.
-        * @return mixed $object the original object. If not within arguments and of type string, the value is htmlspecialchar'ed
-        */
-       public function process($object, $enabled);
-
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/Core/Rendering/RenderingConfiguration.php b/typo3/sysext/fluid/Classes/Core/Rendering/RenderingConfiguration.php
deleted file mode 100644 (file)
index fc1b3fd..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/*                                                                        *
- * This script belongs to the FLOW3 package "Fluid".                      *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * 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 Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * The rendering configuration. Contains all configuration needed to configure the rendering of a SyntaxTree.
- * This currently contains:
- * - the active ObjectAccessorPostProcessor, if any
- *
- * @version $Id$
- * @package Fluid
- * @subpackage Core\Rendering
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- * @scope prototype
- */
-class Tx_Fluid_Core_Rendering_RenderingConfiguration {
-
-       /**
-        * Object accessor post processor to use
-        * @var Tx_Fluid_Core_Rendering_ObjectAccessorPostProcessorInterface
-        */
-       protected $objectAccessorPostProcessor;
-
-       /**
-        * Set the Object accessor post processor
-        *
-        * @param Tx_Fluid_Core_Rendering_ObjectAccessorPostProcessorInterface $objectAccessorPostProcessor The ObjectAccessorPostProcessor to set
-        * @return void
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function setObjectAccessorPostProcessor(Tx_Fluid_Core_Rendering_ObjectAccessorPostProcessorInterface $objectAccessorPostProcessor) {
-               $this->objectAccessorPostProcessor = $objectAccessorPostProcessor;
-       }
-
-       /**
-        * Get the currently set ObjectAccessorPostProcessor
-        *
-        * @return Tx_Fluid_Core_Rendering_ObjectAccessorPostProcessorInterface The currently set ObjectAccessorPostProcessor, or NULL if none set.
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function getObjectAccessorPostProcessor() {
-               return $this->objectAccessorPostProcessor;
-       }
-}
-?>
\ No newline at end of file
index ad961e1..ab23edd 100644 (file)
@@ -38,11 +38,11 @@ class Tx_Fluid_Core_Rendering_RenderingContext {
        protected $templateVariableContainer;
 
        /**
-        * Object factory which is bubbled through. The ViewHelperNode cannot get an ObjectFactory injected because
+        * Object factory which is bubbled through. The ViewHelperNode cannot get an ObjectManager injected because
         * the whole syntax tree should be cacheable
-        * @var Tx_Fluid_Compatibility_ObjectFactory
+        * @var Tx_Fluid_Compatibility_ObjectManager
         */
-       protected $objectFactory;
+       protected $objectManager;
 
        /**
         * Controller context being passed to the ViewHelper
@@ -51,41 +51,29 @@ class Tx_Fluid_Core_Rendering_RenderingContext {
        protected $controllerContext;
 
        /**
-        * Rendering Context
-        * @var Tx_Fluid_Core_Rendering_RenderingConfiguration
-        */
-       protected $renderingConfiguration;
-
-       /**
         * ViewHelper Variable Container
         * @var Tx_Fluid_Core_ViewHelpers_ViewHelperVariableContainer
         */
        protected $viewHelperVariableContainer;
 
        /**
-        * TRUE if the arguments of a ViewHelper are currently evaluated
-        * @var boolean
-        */
-       protected $objectAccessorPostProcessorEnabled = TRUE;
-
-       /**
         * Inject the object factory
         *
-        * @param Tx_Fluid_Compatibility_ObjectFactory $objectFactory
+        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function injectObjectFactory(Tx_Fluid_Compatibility_ObjectFactory $objectFactory) {
-               $this->objectFactory = $objectFactory;
+       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+               $this->objectManager = $objectManager;
        }
 
        /**
         * Returns the object factory. Only the ViewHelperNode should do this.
         *
-        * @param Tx_Fluid_Compatibility_ObjectFactory $objectFactory
+        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function getObjectFactory() {
-               return $this->objectFactory;
+       public function getObjectManager() {
+               return $this->objectManager;
        }
 
        /**
@@ -130,48 +118,6 @@ class Tx_Fluid_Core_Rendering_RenderingContext {
        }
 
        /**
-        * Set the rendering configuration for the current rendering process
-        *
-        * @param Tx_Fluid_Core_Rendering_RenderingConfiguration $renderingConfiguration The Rendering Configuration to be set
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function setRenderingConfiguration(Tx_Fluid_Core_Rendering_RenderingConfiguration $renderingConfiguration) {
-               $this->renderingConfiguration = $renderingConfiguration;
-       }
-
-       /**
-        * Get the current rendering configuration
-        *
-        * @return Tx_Fluid_Core_Rendering_RenderingConfiguration The rendering configuration currently active
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function getRenderingConfiguration() {
-               return $this->renderingConfiguration;
-       }
-
-       /**
-        * Set the argument evaluation mode. Should be set to TRUE if the arguments are currently being parsed.
-        * FALSE if we do not parse arguments currently
-        *
-        * @param boolean $objectAccessorPostProcessorEnabled Argument evaluation mode to be set
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function setObjectAccessorPostProcessorEnabled($objectAccessorPostProcessorEnabled) {
-               $this->objectAccessorPostProcessorEnabled = (boolean)$objectAccessorPostProcessorEnabled;
-       }
-
-       /**
-        * if TRUE, then we are currently in Argument Evaluation mode. False otherwise.
-        * Is used to make sure that ObjectAccessors are PostProcessed if we are NOT in Argument Evaluation Mode
-        *
-        * @return boolean TRUE if we are currently evaluating arguments, FALSE otherwise
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function isObjectAccessorPostProcessorEnabled() {
-               return $this->objectAccessorPostProcessorEnabled;
-       }
-
-       /**
         * Set the ViewHelperVariableContainer
         *
         * @param Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer $viewHelperVariableContainer
diff --git a/typo3/sysext/fluid/Classes/Core/RuntimeException.php b/typo3/sysext/fluid/Classes/Core/RuntimeException.php
deleted file mode 100644 (file)
index 398edae..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-/*                                                                        *
- * This script belongs to the FLOW3 package "Fluid".                      *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * 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 Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * A Runtime Exception
- *
- * @version $Id$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- * @internal
- */
-class Tx_Fluid_Core_RuntimeException extends Tx_Fluid_Core_Exception {
-}
-?>
index 9f62a31..f6c6696 100644 (file)
@@ -79,20 +79,20 @@ abstract class Tx_Fluid_Core_ViewHelper_AbstractViewHelper implements Tx_Fluid_C
        protected $viewHelperVariableContainer;
 
        /**
-        * If the ObjectAccessorPostProcessor should be disabled inside this ViewHelper, then set this value to FALSE.
-        * This is internal and NO part of the API. It is very likely to change.
-        *
-        * @var boolean
-        */
-       protected $objectAccessorPostProcessorEnabled = TRUE;
-
-       /**
         * Reflection service
         * @var Tx_Extbase_Reflection_Service
         */
        private $reflectionService;
 
        /**
+        * With this flag, you can disable the escaping interceptor inside this ViewHelper.
+        * THIS MIGHT CHANGE WITHOUT NOTICE, NO PUBLIC API!
+        * @var boolean
+        * @internal
+        */
+       protected $escapingInterceptorEnabled = TRUE;
+
+       /**
         * @param Tx_Fluid_Core_ViewHelper_Arguments $arguments
         * @return void
         * @author Bastian Waidelich <bastian@typo3.org>
@@ -138,14 +138,15 @@ abstract class Tx_Fluid_Core_ViewHelper_AbstractViewHelper implements Tx_Fluid_C
        }
 
        /**
-        * Returns TRUE if the object accessor post processor should be disabled inside this ViewHelper.
-        * This is internal and NO part of the API. It is very likely to change.
+        * Returns whether the escaping interceptor should be disabled or enabled inside the tags contents.
         *
-        * @return boolean TRUE if Object accessor post processor is enabled, FALSE if disabled
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * THIS METHOD MIGHT CHANGE WITHOUT NOTICE; NO PUBLIC API!
+        *
+        * @internal
+        * @return boolean
         */
-       public function isObjectAccessorPostProcessorEnabled() {
-               return $this->objectAccessorPostProcessorEnabled;
+       public function isEscapingInterceptorEnabled() {
+               return $this->escapingInterceptorEnabled;
        }
 
        /**
index b68f72d..f58baa2 100644 (file)
@@ -135,6 +135,7 @@ abstract class Tx_Fluid_Core_ViewHelper_TagBasedViewHelper extends Tx_Fluid_Core
                $this->registerTagAttribute('title', 'string', 'Tooltip text of element');
                $this->registerTagAttribute('accesskey', 'string', 'Keyboard shortcut to access this element');
                $this->registerTagAttribute('tabindex', 'integer', 'Specifies the tab order of this element');
+               $this->registerTagAttribute('onclick', 'string', 'JavaScript evaluated for the onclick event');
        }
 }
 ?>
\ No newline at end of file
index 80b3bac..6c02664 100644 (file)
 class Tx_Fluid_Core_ViewHelper_TemplateVariableContainer {
 
        /**
-        * List of reserved words that can't be used as object identifiers in Fluid templates
+        * List of reserved words that can't be used as variable identifiers in Fluid templates
         * @var array
         */
-       static protected $reservedKeywords = array('true', 'false');
+       static protected $reservedVariableNames = array('true', 'false', 'on', 'off', 'yes', 'no');
 
        /**
-        * Objects stored in context
+        * Variables stored in context
         * @var array
         */
-       protected $objects = array();
+       protected $variables = array();
 
        /**
-        * Constructor. Can take an array, and initializes the objects with it.
+        * Constructor. Can take an array, and initializes the variables with it.
         *
-        * @param array $objectArray
+        * @param array $variableArray
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         * @api
         */
-       public function __construct($objectArray = array()) {
-               if (!is_array($objectArray)) throw new RuntimeException('Context has to be initialized with an array, ' . gettype($objectArray) . ' given.', 1224592343);
-               $this->objects = $objectArray;
+       public function __construct($variableArray = array()) {
+               if (!is_array($variableArray)) throw new RuntimeException('Context has to be initialized with an array, ' . gettype($variableArray) . ' given.', 1224592343);
+               $this->variables = $variableArray;
        }
 
        /**
-        * Add an object to the context
+        * Add a variable to the context
         *
-        * @param string $identifier
-        * @param object $object
+        * @param string $identifier Identifier of the variable to add
+        * @param mixed $value The variable's value
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         * @author Bastian Waidelich <bastian@typo3.org>
         * @api
         */
-       public function add($identifier, $object) {
-               if (array_key_exists($identifier, $this->objects)) throw new RuntimeException('Duplicate variable declarations!', 1224479063);
-               if (in_array(strtolower($identifier), self::$reservedKeywords)) throw new RuntimeException('"' . $identifier . '" is a reserved keyword and can\'t be used as variable identifier.', 1256730379);
-               $this->objects[$identifier] = $object;
+       public function add($identifier, $value) {
+               if (array_key_exists($identifier, $this->variables)) throw new RuntimeException('Duplicate variable declarations!', 1224479063);
+               if (in_array(strtolower($identifier), self::$reservedVariableNames)) throw new RuntimeException('"' . $identifier . '" is a reserved variable name and can\'t be used as variable identifier.', 1256730379);
+               $this->variables[$identifier] = $value;
        }
 
        /**
-        * Get an object from the context. Throws exception if object is not found in context.
+        * Get a variable from the context. Throws exception if variable is not found in context.
         *
         * @param string $identifier
-        * @return object The object identified by $identifier
+        * @return variable The variable identified by $identifier
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         * @api
         */
        public function get($identifier) {
-               if (!array_key_exists($identifier, $this->objects)) throw new RuntimeException('Tried to get a variable "' . $identifier . '" which is not stored in the context!', 1224479370);
-               return $this->objects[$identifier];
+               if (!array_key_exists($identifier, $this->variables)) throw new RuntimeException('Tried to get a variable "' . $identifier . '" which is not stored in the context!', 1224479370);
+               return $this->variables[$identifier];
        }
 
        /**
-        * Remove an object from context. Throws exception if object is not found in context.
+        * Remove a variable from context. Throws exception if variable is not found in context.
         *
         * @param string $identifier The identifier to remove
         * @return void
@@ -98,8 +98,8 @@ class Tx_Fluid_Core_ViewHelper_TemplateVariableContainer {
         * @api
         */
        public function remove($identifier) {
-               if (!array_key_exists($identifier, $this->objects)) throw new RuntimeException('Tried to remove a variable "' . $identifier . '" which is not stored in the context!', 1224479372);
-               unset($this->objects[$identifier]);
+               if (!array_key_exists($identifier, $this->variables)) throw new RuntimeException('Tried to remove a variable "' . $identifier . '" which is not stored in the context!', 1224479372);
+               unset($this->variables[$identifier]);
        }
 
        /**
@@ -109,7 +109,7 @@ class Tx_Fluid_Core_ViewHelper_TemplateVariableContainer {
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function getAllIdentifiers() {
-               return array_keys($this->objects);
+               return array_keys($this->variables);
        }
 
        /**
@@ -121,7 +121,7 @@ class Tx_Fluid_Core_ViewHelper_TemplateVariableContainer {
         * @api
         */
        public function exists($identifier) {
-               return array_key_exists($identifier, $this->objects);
+               return array_key_exists($identifier, $this->variables);
        }
 
        /**
@@ -131,7 +131,7 @@ class Tx_Fluid_Core_ViewHelper_TemplateVariableContainer {
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function __sleep() {
-               return array('objects');
+               return array('variables');
        }
 }
 ?>
\ No newline at end of file
index ea48ac6..2400bde 100644 (file)
@@ -133,7 +133,7 @@ class Tx_Fluid_Service_DocbookGenerator extends Tx_Fluid_Service_AbstractGenerat
         * @return object
         */
        protected function instanciateViewHelper($className) {
-               return $this->objectManager->getObject($className);
+               return $this->objectManager->get($className);
        }
 
        /**
diff --git a/typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResource.php b/typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResource.php
deleted file mode 100644 (file)
index 32e01d7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/*                                                                        *
- * This script belongs to the FLOW3 package "Fluid".                      *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * 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 Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * An "Invalid Template Resource" exception
- *
- * @version $Id$
- * @package Fluid
- * @subpackage View\Exception
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- * @api
- */
-class Tx_Fluid_View_Exception_InvalidTemplateResource extends Tx_Fluid_View_Exception {
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResourceException.php b/typo3/sysext/fluid/Classes/View/Exception/InvalidTemplateResourceException.php
new file mode 100644 (file)
index 0000000..4f0792e
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * An "Invalid Template Resource" exception
+ *
+ * @version $Id: InvalidTemplateResourceException.php 3643 2010-01-15 14:38:07Z robert $
+ * @package Fluid
+ * @subpackage View\Exception
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ */
+class Tx_Fluid_View_Exception_InvalidTemplateResourceException extends Tx_Fluid_View_Exception {
+}
+
+?>
\ No newline at end of file
index 1aef2b7..51b8d8a 100644 (file)
 class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implements Tx_Fluid_View_TemplateViewInterface {
 
        /**
-        * Pattern for fetching information from controller object name
-        * @var string
-        */
-       protected $PATTERN_CONTROLLER = '/^TxFLUID_NAMESPACE_SEPARATOR\w*FLUID_NAMESPACE_SEPARATOR(?:(?P<SubpackageName>.*)FLUID_NAMESPACE_SEPARATOR)?ControllerFLUID_NAMESPACE_SEPARATOR(?P<ControllerName>\w*)Controller$/';
-
-       /**
         * @var Tx_Fluid_Core_Parser_TemplateParser
         */
        protected $templateParser;
@@ -63,16 +57,19 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
 
        /**
         * Path to the template root. If NULL, then $this->templateRootPathPattern will be used.
+        * @var string
         */
        protected $templateRootPath = NULL;
 
        /**
         * Path to the partial root. If NULL, then $this->partialRootPathPattern will be used.
+        * @var string
         */
        protected $partialRootPath = NULL;
 
        /**
         * Path to the layout root. If NULL, then $this->layoutRootPathPattern will be used.
+        * @var string
         */
        protected $layoutRootPath = NULL;
 
@@ -108,7 +105,7 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
 
        public function __construct() {
                                                $this->templateParser = Tx_Fluid_Compatibility_TemplateParserBuilder::build();
-                                               $this->objectFactory = t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectFactory');
+                                               $this->objectManager = t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectManager');
                                        }
        // Here, the backporter can insert a constructor method, which is needed for Fluid v4.
 
@@ -160,23 +157,23 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
 
        /**
         * Build the rendering context
+        *
+        * @param Tx_Fluid_Core_ViewHelper_TemplateVariableContainer $variableContainer
+        * @return Tx_Fluid_Core_Rendering_RenderingContext
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       protected function buildRenderingContext($variableContainer = NULL) {
+       protected function buildRenderingContext(Tx_Fluid_Core_ViewHelper_TemplateVariableContainer $variableContainer = NULL) {
                if ($variableContainer === NULL) {
-                       $variableContainer = $this->objectFactory->create('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer', $this->viewData);
+                       $variableContainer = $this->objectManager->create('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer', $this->variables);
                }
-               $renderingConfiguration = $this->objectFactory->create('Tx_Fluid_Core_Rendering_RenderingConfiguration');
-               $renderingConfiguration->setObjectAccessorPostProcessor($this->objectFactory->create('Tx_Fluid_Core_Rendering_HtmlSpecialCharsPostProcessor'));
 
-               $renderingContext = $this->objectFactory->create('Tx_Fluid_Core_Rendering_RenderingContext');
+               $renderingContext = $this->objectManager->create('Tx_Fluid_Core_Rendering_RenderingContext');
                $renderingContext->setTemplateVariableContainer($variableContainer);
                if ($this->controllerContext !== NULL) {
                        $renderingContext->setControllerContext($this->controllerContext);
                }
-               $renderingContext->setRenderingConfiguration($renderingConfiguration);
 
-               $viewHelperVariableContainer = $this->objectFactory->create('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer');
+               $viewHelperVariableContainer = $this->objectManager->create('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer');
                $viewHelperVariableContainer->setView($this);
                $renderingContext->setViewHelperVariableContainer($viewHelperVariableContainer);
 
@@ -184,6 +181,21 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
        }
 
        /**
+        * Build parser configuration
+        *
+        * @return Tx_Fluid_Core_Parser_Configuration
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       protected function buildParserConfiguration() {
+               $parserConfiguration = $this->objectManager->create('Tx_Fluid_Core_Parser_Configuration');
+               if ($this->controllerContext->getRequest()->getFormat() === 'html') {
+                       $parserConfiguration->addInterceptor($this->objectManager->get('Tx_Fluid_Core_Parser_Interceptor_Escape'));
+                       
+               }
+               return $parserConfiguration;
+       }
+
+       /**
         * Find the XHTML template according to $this->templatePathAndFilenamePattern and render the template.
         * If "layoutName" is set in a PostParseFacet callback, it will render the file with the given layout.
         *
@@ -195,6 +207,7 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
        public function render($actionName = NULL) {
                $templatePathAndFilename = $this->resolveTemplatePathAndFilename($actionName);
 
+               $this->templateParser->setConfiguration($this->buildParserConfiguration());
                $parsedTemplate = $this->parseTemplate($templatePathAndFilename);
 
                $variableContainer = $parsedTemplate->getVariableContainer();
@@ -202,8 +215,7 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
                        return $this->renderWithLayout($variableContainer->get('layoutName'));
                }
 
-               $renderingContext = $this->buildRenderingContext();
-               return $parsedTemplate->render($renderingContext);
+               return $parsedTemplate->render($this->buildRenderingContext());
        }
 
        /**
@@ -236,7 +248,7 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
         * Renders a given section.
         *
         * @param string $sectionName Name of section to render
-        * @return rendered template for the section
+        * @return string rendered template for the section
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         * @author Bastian Waidelich <bastian@typo3.org>
         */
@@ -298,15 +310,18 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
 
        /**
         * Renders a partial.
-        * SHOULD NOT BE USED BY USERS!
         *
+        * @param string $partialName
+        * @param string $sectionToRender
+        * @param array $variables
+        * @return string
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         * @author Bastian Waidelich <bastian@typo3.org>
         * @author Robert Lemke <robert@typo3.org>
         */
        public function renderPartial($partialName, $sectionToRender, array $variables) {
                $partial = $this->parseTemplate($this->resolvePartialPathAndFilename($partialName));
-               $variableContainer = $this->objectFactory->create('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer', $variables);
+               $variableContainer = $this->objectManager->create('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer', $variables);
                $renderingContext = $this->buildRenderingContext($variableContainer);
                return $partial->render($renderingContext);
        }
@@ -353,11 +368,14 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
         *
         * @param string $templatePathAndFilename absolute filename of the template to be parsed
         * @return Tx_Fluid_Core_Parser_ParsedTemplateInterface the parsed template tree
+        * @throws Tx_Fluid_View_Exception_InvalidTemplateResourceException
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        protected function parseTemplate($templatePathAndFilename) {
                $templateSource = file_get_contents($templatePathAndFilename);
-
+               if ($templateSource === FALSE) {
+                       throw new Tx_Fluid_View_Exception_InvalidTemplateResourceException('"' . $templatePathAndFilename . '" is not a valid template resource URI.', 1257246929);
+               }
                return $this->templateParser->parse($templateSource);
        }
 
@@ -468,25 +486,17 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
         * @param boolean $formatIsOptional if TRUE, then half of the resulting strings will have .@format stripped off, and the other half will have it.
         * @return array unix style path
         * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Robert Lemke <robert@typo3.org>
         */
        protected function expandGenericPathPattern($pattern, $bubbleControllerAndSubpackage, $formatIsOptional) {
                $pattern = str_replace('@templateRoot', $this->getTemplateRootPath(), $pattern);
                $pattern = str_replace('@partialRoot', $this->getPartialRootPath(), $pattern);
                $pattern = str_replace('@layoutRoot', $this->getLayoutRootPath(), $pattern);
 
-               $matches = array();
-               $this->PATTERN_CONTROLLER = str_replace('FLUID_NAMESPACE_SEPARATOR', preg_quote(Tx_Fluid_Fluid::NAMESPACE_SEPARATOR), $this->PATTERN_CONTROLLER);
-               preg_match($this->PATTERN_CONTROLLER, $this->controllerContext->getRequest()->getControllerObjectName(), $matches);
-
-               $subpackageParts = array();
-               if ($matches['SubpackageName'] !== '') {
-                       $subpackageParts = explode(Tx_Fluid_Fluid::NAMESPACE_SEPARATOR, $matches['SubpackageName']);
-               }
+               $subPackageKey = '';
+               $controllerName = $this->controllerContext->getRequest()->getControllerName();
 
-               $controllerName = NULL;
-               if (strpos($pattern, '@controller') !== FALSE) {
-                       $controllerName = $matches['ControllerName'];
-               }
+               $subpackageParts = ($subPackageKey !== '') ? explode(Tx_Fluid_Fluid::NAMESPACE_SEPARATOR, $subPackageKey) : array();
 
                $results = array();
 
@@ -515,4 +525,5 @@ class Tx_Fluid_View_TemplateView extends Tx_Extbase_MVC_View_AbstractView implem
                return $results;
        }
 }
+
 ?>
\ No newline at end of file
index d3b4d9d..5efd040 100644 (file)
 interface Tx_Fluid_View_TemplateViewInterface extends Tx_Extbase_MVC_View_ViewInterface {
 
        /**
-        * Inject the template parser
-        *
-        * @param Tx_Fluid_Core_Parser_TemplateParser $templateParser The template parser
-        * @return void
-        * @api
-        */
-       public function injectTemplateParser(Tx_Fluid_Core_Parser_TemplateParser $templateParser);
-
-       /**
         * Sets the path and name of of the template file. Effectively overrides the
         * dynamic resolving of a template file.
         *
index 6d3161c..8184052 100644 (file)
@@ -31,7 +31,7 @@
  * <f:base />
  * </code>
  * <output>
- * <base href="http://yourdomain.tld/"></base>
+ * <base href="http://yourdomain.tld/" />
  * (depending on your domain)
  * </output>
  *
@@ -55,8 +55,7 @@ class Tx_Fluid_ViewHelpers_BaseViewHelper extends Tx_Fluid_Core_ViewHelper_Abstr
         * @api
         */
        public function render() {
-               $currentRequest = $this->controllerContext->getRequest();
-               return '<base href="' . $currentRequest->getBaseUri() . '"></base>';
+               return '<base href="' . $this->controllerContext->getRequest()->getBaseUri() . '" />';
        }
 }
 
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/EscapeViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/EscapeViewHelper.php
new file mode 100644 (file)
index 0000000..814f7d0
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * The EscapeViewHelper is used to escape variable content in various ways. By
+ * default HTML is the target.
+ *
+ * = Examples =
+ *
+ * <code title="HTML">
+ * <f:escape>{text}</f:escape>
+ * </code>
+ *
+ * Output:
+ * Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied).
+ *
+ * <code title="Entities">
+ * <f:escape type="entities">{text}</f:escape>
+ * </code>
+ *
+ * Output:
+ * Text with all possible chars replaced by HTML entities (htmlentities applied).
+ *
+ * <code title="URL">
+ * <f:escape type="url">{text}</f:escape>
+ * </code>
+ *
+ * Output:
+ * Text encoded for URL use (rawurlencode applied).
+ *
+ * @version $Id: EscapeViewHelper.php 3751 2010-01-22 15:56:47Z k-fish $
+ * @package Fluid
+ * @subpackage ViewHelpers
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ * @scope prototype
+ */
+class Tx_Fluid_ViewHelpers_EscapeViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
+
+       /**
+        * Escapes special characters with their escaped counterparts as needed.
+        *
+        * @param string $value
+        * @param string $type The type, one of html, entities, url
+        * @param string $encoding
+        * @return string the altered string.
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        * @api
+        */
+       public function render($value = NULL, $type = 'html', $encoding = 'UTF-8') {
+               if ($value === NULL) {
+                       $value = $this->renderChildren();
+               }
+
+               if (!is_string($value)) {
+                       return $value;
+               }
+
+               switch ($type) {
+                       case 'html':
+                               return htmlspecialchars($value, ENT_COMPAT, $encoding);
+                       break;
+                       case 'entities':
+                               return htmlentities($value, ENT_COMPAT, $encoding);
+                       break;
+                       case 'url':
+                               return rawurlencode($value);
+                       default:
+                               return $value;
+                       break;
+               }
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php
new file mode 100644 (file)
index 0000000..4f6c399
--- /dev/null
@@ -0,0 +1,91 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * View helper which renders the flash messages (if there are any) as an unsorted list.
+ *
+ * In case you need custom Flash Message HTML output, please write your own ViewHelper for the moment.
+ *
+ *
+ * = Examples =
+ *
+ * <code title="Simple">
+ * <f:flashMessages />
+ * </code>
+ * Renders an ul-list of flash messages.
+ *
+ * <code title="Output with css class">
+ * <f:flashMessages class="specialClass" />
+ * </code>
+ *
+ * Output:
+ * <ul class="specialClass">
+ *  ...
+ * </ul>
+ *
+ * @version $Id: ForViewHelper.php 2914 2009-07-28 18:26:38Z bwaidelich $
+ * @package Fluid
+ * @subpackage ViewHelpers
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ * @scope prototype
+ */
+class Tx_Fluid_ViewHelpers_FlashMessagesViewHelper extends Tx_Fluid_Core_ViewHelper_TagBasedViewHelper {
+
+       /**
+        * @var string
+        */
+       protected $tagName = 'ul';
+
+       /**
+        * Initialize arguments
+        *
+        * @return void
+        * @author Sebastian Kurfürst <sbastian@typo3.org>
+        * @api
+        */
+       public function initializeArguments() {
+               $this->registerUniversalTagAttributes();
+       }
+
+       /**
+        * Render method.
+        *
+        * @return string rendered Flash Messages, if there are any.
+        * @author Sebastian Kurfürst <sbastian@typo3.org>
+        * @api
+        */
+       public function render() {
+               $flashMessages = $this->controllerContext->getFlashMessageContainer()->getAllAndFlush();
+               if (count($flashMessages) > 0) {
+                       $tagContent = '';
+                       foreach ($flashMessages as $singleFlashMessage) {
+                               $tagContent .=  '<li>' . htmlspecialchars($singleFlashMessage) . '</li>';
+                       }
+                       $this->tag->setContent($tagContent);
+                       return $this->tag->render();
+               }
+               return '';
+       }
+}
+
+?>
index 3ba0924..08eb6ec 100644 (file)
@@ -95,6 +95,7 @@ class Tx_Fluid_ViewHelpers_Form_SelectViewHelper extends Tx_Fluid_ViewHelpers_Fo
                $this->registerArgument('options', 'array', 'Associative array with internal IDs as key, and the values are displayed in the select box', TRUE);
                $this->registerArgument('optionValueField', 'string', 'If specified, will call the appropriate getter on each object to determine the value.');
                $this->registerArgument('optionLabelField', 'string', 'If specified, will call the appropriate getter on each object to determine the label.');
+               $this->registerArgument('sortByOptionLabel', 'boolean', 'If true, List will be sorted by label.', FALSE, FALSE);
                $this->registerArgument('errorClass', 'string', 'CSS class to set if there are errors for this view helper', FALSE, 'f3-form-error');
        }
 
@@ -115,6 +116,9 @@ class Tx_Fluid_ViewHelpers_Form_SelectViewHelper extends Tx_Fluid_ViewHelpers_Fo
                $this->tag->addAttribute('name', $name);
 
                $options = $this->getOptions();
+               if (empty($options)) {
+                       $options = array('' => '');
+               }
                $this->tag->setContent($this->renderOptionTags($options));
 
                $this->setErrorClassAttribute();
@@ -158,6 +162,9 @@ class Tx_Fluid_ViewHelpers_Form_SelectViewHelper extends Tx_Fluid_ViewHelpers_Fo
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        protected function getOptions() {
+               if (!is_array($this->arguments['options']) && !($this->arguments['options'] instanceof Iterator)) {
+                       return array();
+               }
                $options = array();
                foreach ($this->arguments['options'] as $key => $value) {
                        if (is_object($value)) {
@@ -196,6 +203,9 @@ class Tx_Fluid_ViewHelpers_Form_SelectViewHelper extends Tx_Fluid_ViewHelpers_Fo
                        }
                        $options[$key] = $value;
                }
+               if ($this->arguments['sortByOptionLabel']) {
+                       asort($options);
+               }
                return $options;
        }
 
index 1df2cf7..0dc81ab 100644 (file)
@@ -21,6 +21,8 @@
  *                                                                        */
 
 /**
+ * DEPRECATED: Use <f:form.textfield> instead!
+ *
  * View Helper which creates a simple Text Box (<input type="text">).
  *
   * = Examples =
@@ -38,6 +40,7 @@
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  * @api
  * @scope prototype
+ * @deprecated since 1.0.0 alpha 7
  */
 class Tx_Fluid_ViewHelpers_Form_TextboxViewHelper extends Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper {
 
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php
new file mode 100644 (file)
index 0000000..10b4c08
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * 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 Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * View Helper which creates a text field (<input type="text">).
+ *
+  * = Examples =
+ *
+ * <code title="Example">
+ * <f:form.textfield name="myTextBox" value="default value" />
+ * </code>
+ *
+ * Output:
+ * <input type="text" name="myTextBox" value="default value" />
+ *
+ * @version $Id: TextfieldViewHelper.php 3628 2010-01-14 15:31:38Z robert $
+ * @package Fluid
+ * @subpackage ViewHelpers\Form
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ * @scope prototype
+ */
+class Tx_Fluid_ViewHelpers_Form_TextfieldViewHelper extends Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper {
+
+       /**
+        * @var string
+        */
+       protected $tagName = 'input';
+
+       /**
+        * Initialize the arguments.
+        *
+        * @return void
+        * @author Robert Lemke <robert@typo3.org>
+        * @api
+        */
+       public function initializeArguments() {
+               parent::initializeArguments();
+               $this->registerTagAttribute('disabled', 'string', 'Specifies that the input element should be disabled when the page loads');
+               $this->registerTagAttribute('maxlength', 'int', 'The maxlength attribute of the input field (will not be validated)');
+               $this->registerTagAttribute('readonly', 'string', 'The readonly attribute of the input field');
+               $this->registerTagAttribute('size', 'int', 'The size of the input field');
+               $this->registerArgument('errorClass', 'string', 'CSS class to set if there are errors for this view helper', FALSE, 'f3-form-error');
+               $this->registerUniversalTagAttributes();
+       }
+
+       /**
+        * Renders the textfield.
+        *
+        * @param boolean $required If the field is required or not
+        * @param string $type The field type, e.g. "text", "email", "url" etc.
+        * @param string $placeholder A string used as a placeholder for the value to enter
+        * @return string
+        * @author Robert Lemke <robert@typo3.org>
+        * @api
+        */
+       public function render($required = NULL, $type = 'text', $placeholder = NULL) {
+               $name = $this->getName();
+               $this->registerFieldNameForFormTokenGeneration($name);
+
+               $this->tag->addAttribute('type', $type);
+               $this->tag->addAttribute('name', $name);
+
+               $value = $this->getValue();
+
+               if ($placeholder !== NULL) {
+                       $this->tag->addAttribute('placeholder', $placeholder);
+               }
+
+               if (!empty($value)) {
+                       $this->tag->addAttribute('value', $value);
+               }
+
+               if ($required !== NULL) {
+                       $this->tag->addAttribute('required', 'required');
+               }
+
+               $this->setErrorClassAttribute();
+
+               return $this->tag->render();
+       }
+
+}
+
+?>
\ No newline at end of file
index 1f7faed..f2d46f3 100644 (file)
@@ -53,13 +53,13 @@ class Tx_Fluid_ViewHelpers_Format_HtmlViewHelper extends Tx_Fluid_Core_ViewHelpe
        protected $contentObject;
 
        /**
-        * If the ObjectAccessorPostProcessor should be disabled inside this ViewHelper, then set this value to FALSE.
+        * If the escaping interceptor should be disabled inside this ViewHelper, then set this value to FALSE.
         * This is internal and NO part of the API. It is very likely to change.
         *
         * @var boolean
         * @internal
         */
-       protected $objectAccessorPostProcessorEnabled = FALSE;
+       protected $escapingInterceptorEnabled = FALSE;
 
        /**
         * Constructor. Used to create an instance of tslib_cObj used by the render() method.
index 106cc10..7c0bf15 100644 (file)
  *                                                                        */
 
 /**
- * View helper which renders the flash messages (if there are any) as an unsorted list.
- *
- * In case you need custom Flash Message HTML output, please write your own ViewHelper for the moment.
- *
- *
- * = Examples =
- *
- * <code title="Simple">
- * <f:renderFlashMessages />
- * </code>
- * Renders an ul-list of flash messages.
- *
- * <code title="Output with css class">
- * <f:renderFlashMessages class="specialClass" />
- * </code>
- *
- * Output:
- * <ul class="specialClass">
- *  ...
- * </ul>
+ * Deprecated. Use <f:flashMessages> instead!
  *
  * @version $Id$
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  * @scope prototype
  */
-class Tx_Fluid_ViewHelpers_RenderFlashMessagesViewHelper extends Tx_Fluid_Core_ViewHelper_TagBasedViewHelper {
-
-       /**
-        * @var string
-        */
-       protected $tagName = 'ul';
-
-       /**
-        * Initialize arguments
-        *
-        * @return void
-        * @author Sebastian Kurfürst <sbastian@typo3.org>
-        * @api
-        */
-       public function initializeArguments() {
-               $this->registerUniversalTagAttributes();
-       }
+class Tx_Fluid_ViewHelpers_RenderFlashMessagesViewHelper extends Tx_Fluid_ViewHelpers_FlashMessagesViewHelper {
 
-       /**
-        * Render method.
-        *
-        * @return string rendered Flash Messages, if there are any.
-        * @author Sebastian Kurfürst <sbastian@typo3.org>
-        * @api
-        */
-       public function render() {
-               $flashMessages = $this->controllerContext->getFlashMessages()->getAllAndFlush();
-               if (count($flashMessages) > 0) {
-                       $tagContent = '';
-                       foreach ($flashMessages as $singleFlashMessage) {
-                               $tagContent .=  '<li>' . htmlspecialchars($singleFlashMessage) . '</li>';
-                       }
-                       $this->tag->setContent($tagContent);
-                       return $this->tag->render();
-               }
-               return '';
-       }
 }
 
 ?>
index af451eb..931f381 100644 (file)
@@ -22,7 +22,7 @@
 
 require_once(dirname(__FILE__) . '/ViewHelperBaseTestcase.php');
 /**
- * @version $Id: BaseViewHelperTest.php 3952 2010-03-16 08:00:53Z sebastian $
+ * @version $Id: BaseViewHelperTest.php 3954 2010-03-16 08:36:26Z sebastian $
  */
 class Tx_Fluid_ViewHelpers_BaseViewHelperTest extends Tx_Fluid_ViewHelpers_ViewHelperBaseTestcase {
        /**
@@ -37,7 +37,7 @@ class Tx_Fluid_ViewHelpers_BaseViewHelperTest extends Tx_Fluid_ViewHelpers_ViewH
                $viewHelper = new Tx_Fluid_ViewHelpers_BaseViewHelper();
                $this->injectDependenciesIntoViewHelper($viewHelper);
 
-               $expectedResult = '<base href="' . $baseUri . '"></base>';
+               $expectedResult = '<base href="' . $baseUri . '" />';
                $actualResult = $viewHelper->render();
                $this->assertSame($expectedResult, $actualResult);
        }
index 20745f9..6643183 100644 (file)
@@ -17,6 +17,7 @@ return array(
        'tx_fluid_core_parser_templateparser' => $extensionClassesPath . 'Core/Parser/TemplateParser.php',
        'tx_fluid_core_parser_syntaxtree_abstractnode' => $extensionClassesPath . 'Core/Parser/SyntaxTree/AbstractNode.php',
        'tx_fluid_core_parser_syntaxtree_arraynode' => $extensionClassesPath . 'Core/Parser/SyntaxTree/ArrayNode.php',
+       'tx_fluid_core_parser_syntaxtree_nodeinterface' => $extensionClassesPath . 'Core/Parser/SyntaxTree/NodeInterface.php',
        'tx_fluid_core_parser_syntaxtree_objectaccessornode' => $extensionClassesPath . 'Core/Parser/SyntaxTree/ObjectAccessorNode.php',
        'tx_fluid_core_parser_syntaxtree_rootnode' => $extensionClassesPath . 'Core/Parser/SyntaxTree/RootNode.php',
        'tx_fluid_core_parser_syntaxtree_textnode' => $extensionClassesPath . 'Core/Parser/SyntaxTree/TextNode.php',
index d0fda02..eed1a1e 100755 (executable)
@@ -29,7 +29,7 @@ $EM_CONF[$_EXTKEY] = array(
        'clearCacheOnLoad' => 0,
        'lockType' => '',
        'author_company' => '',
-       'version' => '1.0.0',
+       'version' => '1.1.0alpha1',
        'constraints' => array(
                'depends' => array(
                        'extbase' => '',
@@ -44,4 +44,4 @@ $EM_CONF[$_EXTKEY] = array(
        ),
 );
 
-?>
\ No newline at end of file
+?>