[~CLEANUP] apply naming convention for flexForms
authorFelix Oertel <f@oer.tel>
Wed, 9 Mar 2011 20:41:40 +0000 (21:41 +0100)
committerFelix Oertel <f@oer.tel>
Wed, 9 Mar 2011 20:41:40 +0000 (21:41 +0100)
We agreed to write "flexForm" lowerCamelCased.

* change flexform to flexForm
* change Flexform to FlexForm

Change-Id: Ied2f298e345093106cc2d282544faf512ef91456

typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php
typo3/sysext/extbase/Classes/Core/Bootstrap.php
typo3/sysext/extbase/Classes/Service/FlexFormService.php
typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php

index 0dfbb7d..6dea99b 100644 (file)
@@ -99,7 +99,7 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
        /**
         * Get context specific framework configuration.
         * - Overrides storage PID with setting "Startingpoint"
-        * - merge flexform configuration, if needed
+        * - merge flexForm configuration, if needed
         *
         * @param array $frameworkConfiguration The framework configuration to modify
         * @return array the modified framework configuration
@@ -107,7 +107,7 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
        protected function getContextSpecificFrameworkConfiguration(array $frameworkConfiguration) {
                $frameworkConfiguration = $this->overrideStoragePidIfStartingPointIsSet($frameworkConfiguration);
                $frameworkConfiguration = $this->overrideConfigurationFromPlugin($frameworkConfiguration);
-               $frameworkConfiguration = $this->overrideConfigurationFromFlexform($frameworkConfiguration);
+               $frameworkConfiguration = $this->overrideConfigurationFromFlexForm($frameworkConfiguration);
 
                return $frameworkConfiguration;
        }
@@ -161,33 +161,33 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
        }
 
        /**
-        * Overrides configuration settings from flexforms.
-        * This merges the whole flexform data, and overrides switchable controller actions.
+        * Overrides configuration settings from flexForms.
+        * This merges the whole flexForm data, and overrides switchable controller actions.
         *
         * @param array the framework configuration
-        * @return array the framework configuration with overridden data from flexform
+        * @return array the framework configuration with overridden data from flexForm
         */
-       protected function overrideConfigurationFromFlexform(array $frameworkConfiguration) {
+       protected function overrideConfigurationFromFlexForm(array $frameworkConfiguration) {
                if (strlen($this->contentObject->data['pi_flexform']) > 0) {
-                       $flexformConfiguration = $this->flexFormService->convertFlexFormContentToArray($this->contentObject->data['pi_flexform']);
+                       $flexFormConfiguration = $this->flexFormService->convertFlexFormContentToArray($this->contentObject->data['pi_flexform']);
 
-                       $frameworkConfiguration = $this->mergeConfigurationIntoFrameworkConfiguration($frameworkConfiguration, $flexformConfiguration, 'settings');
-                       $frameworkConfiguration = $this->mergeConfigurationIntoFrameworkConfiguration($frameworkConfiguration, $flexformConfiguration, 'persistence');
-                       $frameworkConfiguration = $this->mergeConfigurationIntoFrameworkConfiguration($frameworkConfiguration, $flexformConfiguration, 'view');
+                       $frameworkConfiguration = $this->mergeConfigurationIntoFrameworkConfiguration($frameworkConfiguration, $flexFormConfiguration, 'settings');
+                       $frameworkConfiguration = $this->mergeConfigurationIntoFrameworkConfiguration($frameworkConfiguration, $flexFormConfiguration, 'persistence');
+                       $frameworkConfiguration = $this->mergeConfigurationIntoFrameworkConfiguration($frameworkConfiguration, $flexFormConfiguration, 'view');
 
-                       $frameworkConfiguration = $this->overrideSwitchableControllerActionsFromFlexform($frameworkConfiguration, $flexformConfiguration);
+                       $frameworkConfiguration = $this->overrideSwitchableControllerActionsFromFlexForm($frameworkConfiguration, $flexFormConfiguration);
                }
                return $frameworkConfiguration;
        }
 
        /**
-        * Parses the FlexForm content and converts it to an array
+        * Parses the flexForm content and converts it to an array
         * The resulting array will be multi-dimensional, as a value "bla.blubb"
         * results in two levels, and a value "bla.blubb.bla" results in three levels.
         *
-        * Note: multi-language FlexForms are not supported yet
+        * Note: multi-language flexForms are not supported yet
         *
-        * @param string $flexFormContent FlexForm xml string
+        * @param string $flexFormContent flexForm xml string
         * @return array the processed array
         * @deprecated since Extbase 1.4; will be removed in Extbase 1.6
         */
@@ -197,8 +197,8 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
        }
 
        /**
-        * Parses a flexform node recursively and takes care of sections etc
-        * @param array $nodeArray The flexform node to parse
+        * Parses a flexForm node recursively and takes care of sections etc
+        * @param array $nodeArray The flexForm node to parse
         * @param string $valuePointer The valuePointer to use for value retrieval
         * @deprecated since Extbase 1.4; will be removed in Extbase 1.6
         */
@@ -223,31 +223,31 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
        }
 
        /**
-        * Overrides the switchable controller actions from the flexform.
+        * Overrides the switchable controller actions from the flexForm.
         *
         * @param array $frameworkConfiguration The original framework configuration
-        * @param array $flexformConfiguration The full flexform configuration
+        * @param array $flexFormConfiguration The full flexForm configuration
         * @return array the modified framework configuration, if needed
         */
-       protected function overrideSwitchableControllerActionsFromFlexform(array $frameworkConfiguration, array $flexformConfiguration) {
-               if (!isset($flexformConfiguration['switchableControllerActions']) || is_array($flexformConfiguration['switchableControllerActions'])) {
+       protected function overrideSwitchableControllerActionsFromFlexForm(array $frameworkConfiguration, array $flexFormConfiguration) {
+               if (!isset($flexFormConfiguration['switchableControllerActions']) || is_array($flexFormConfiguration['switchableControllerActions'])) {
                        return $frameworkConfiguration;
                }
 
-                       // As "," is the flexform field value delimiter, we need to use ";" as in-field delimiter. That's why we need to replace ; by  , first.
+                       // As "," is the flexForm field value delimiter, we need to use ";" as in-field delimiter. That's why we need to replace ; by  , first.
                        // The expected format is: "Controller1->action2;Controller2->action3;Controller2->action1"
-               $switchableControllerActionPartsFromFlexform = t3lib_div::trimExplode(',', str_replace(';', ',', $flexformConfiguration['switchableControllerActions']), TRUE);
+               $switchableControllerActionPartsFromFlexForm = t3lib_div::trimExplode(',', str_replace(';', ',', $flexFormConfiguration['switchableControllerActions']), TRUE);
 
-               $newSwitchableControllerActionsFromFlexform = array();
-               foreach ($switchableControllerActionPartsFromFlexform as $switchableControllerActionPartFromFlexform) {
-                       list($controller, $action) = t3lib_div::trimExplode('->', $switchableControllerActionPartFromFlexform);
+               $newSwitchableControllerActionsFromFlexForm = array();
+               foreach ($switchableControllerActionPartsFromFlexForm as $switchableControllerActionPartFromFlexForm) {
+                       list($controller, $action) = t3lib_div::trimExplode('->', $switchableControllerActionPartFromFlexForm);
                        if (empty($controller) || empty($action)) {
-                               throw new Tx_Extbase_Configuration_Exception_ParseError('Controller or action were empty when overriding switchableControllerActions from flexform.', 1257146403);
+                               throw new Tx_Extbase_Configuration_Exception_ParseError('Controller or action were empty when overriding switchableControllerActions from flexForm.', 1257146403);
                        }
-                       $newSwitchableControllerActionsFromFlexform[$controller][] = $action;
+                       $newSwitchableControllerActionsFromFlexForm[$controller][] = $action;
                }
-               if (count($newSwitchableControllerActionsFromFlexform) > 0) {
-                       $this->overrideSwitchableControllerActions($frameworkConfiguration, $newSwitchableControllerActionsFromFlexform);
+               if (count($newSwitchableControllerActionsFromFlexForm) > 0) {
+                       $this->overrideSwitchableControllerActions($frameworkConfiguration, $newSwitchableControllerActionsFromFlexForm);
                }
                return $frameworkConfiguration;
        }
index a1572cf..f2feb05 100644 (file)
@@ -24,7 +24,7 @@
 
 /**
  * Creates a request an dispatches it to the controller which was specified
- * by TS Setup, Flexform and returns the content to the v4 framework.
+ * by TS Setup, flexForm and returns the content to the v4 framework.
  *
  * This class is the main entry point for extbase extensions.
  *
index 00d5bc1..80704ea 100644 (file)
@@ -23,7 +23,7 @@
 ***************************************************************/
 
 /**
- * Utilities to process FlexForms
+ * Utilities to process flexForms
  *
  * @package Extbase
  * @subpackage Service
 class Tx_Extbase_Service_FlexFormService implements t3lib_Singleton {
 
        /**
-        * Parses the FlexForm content and converts it to an array
+        * Parses the flexForm content and converts it to an array
         * The resulting array will be multi-dimensional, as a value "bla.blubb"
         * results in two levels, and a value "bla.blubb.bla" results in three levels.
         *
-        * Note: multi-language FlexForms are not supported yet
+        * Note: multi-language flexForms are not supported yet
         *
-        * @param string $flexFormContent FlexForm xml string
-        * @param string $languagePointer language pointer used in the FlexForm
-        * @param string $valuePointer value pointer used in the FlexForm
+        * @param string $flexFormContent flexForm xml string
+        * @param string $languagePointer language pointer used in the flexForm
+        * @param string $valuePointer value pointer used in the flexForm
         * @return array the processed array
         */
        public function convertFlexFormContentToArray($flexFormContent, $languagePointer = 'lDEF', $valuePointer = 'vDEF') {
@@ -79,9 +79,9 @@ class Tx_Extbase_Service_FlexFormService implements t3lib_Singleton {
        }
 
        /**
-        * Parses a flexform node recursively and takes care of sections etc
+        * Parses a flexForm node recursively and takes care of sections etc
         *
-        * @param array $nodeArray The flexform node to parse
+        * @param array $nodeArray The flexForm node to parse
         * @param string $valuePointer The valuePointer to use for value retrieval
         * @return array
         */
index b7393d4..61c63e7 100644 (file)
@@ -206,7 +206,7 @@ class Tx_Extbase_Tests_Unit_Configuration_FrontendConfigurationManagerTest exten
        /**
         * @test
         */
-       public function overrideSwitchableControllerActionsFromFlexformReturnsUnchangedFrameworkConfigurationIfNoFlexformConfigurationIsFound() {
+       public function overrideSwitchableControllerActionsFromFlexFormReturnsUnchangedFrameworkConfigurationIfNoFlexFormConfigurationIsFound() {
                $frameworkConfiguration = array(
                        'pluginName' => 'Pi1',
                        'extensionName' => 'SomeExtension',
@@ -222,15 +222,15 @@ class Tx_Extbase_Tests_Unit_Configuration_FrontendConfigurationManagerTest exten
                                )
                        )
                );
-               $flexformConfiguration = array();
-               $actualResult = $this->frontendConfigurationManager->_call('overrideSwitchableControllerActionsFromFlexform', $frameworkConfiguration, $flexformConfiguration);
+               $flexFormConfiguration = array();
+               $actualResult = $this->frontendConfigurationManager->_call('overrideSwitchableControllerActionsFromFlexForm', $frameworkConfiguration, $flexFormConfiguration);
                $this->assertSame($frameworkConfiguration, $actualResult);
        }
 
        /**
         * @test
         */
-       public function overrideSwitchableControllerActionsFromFlexformMergesNonCacheableActions() {
+       public function overrideSwitchableControllerActionsFromFlexFormMergesNonCacheableActions() {
                $frameworkConfiguration = array(
                        'pluginName' => 'Pi1',
                        'extensionName' => 'SomeExtension',
@@ -244,7 +244,7 @@ class Tx_Extbase_Tests_Unit_Configuration_FrontendConfigurationManagerTest exten
                                )
                        )
                );
-               $flexformConfiguration = array(
+               $flexFormConfiguration = array(
                        'switchableControllerActions' => 'Controller1  -> action2;Controller2->action3;  Controller2->action1'
                );
                $expectedResult = array(
@@ -260,7 +260,7 @@ class Tx_Extbase_Tests_Unit_Configuration_FrontendConfigurationManagerTest exten
                                )
                        )
                );
-               $actualResult = $this->frontendConfigurationManager->_call('overrideSwitchableControllerActionsFromFlexform', $frameworkConfiguration, $flexformConfiguration);
+               $actualResult = $this->frontendConfigurationManager->_call('overrideSwitchableControllerActionsFromFlexForm', $frameworkConfiguration, $flexFormConfiguration);
                $this->assertEquals($expectedResult, $actualResult);
        }
 
@@ -268,7 +268,7 @@ class Tx_Extbase_Tests_Unit_Configuration_FrontendConfigurationManagerTest exten
         * @test
         * @expectedException Tx_Extbase_Configuration_Exception_ParseError
         */
-       public function overrideSwitchableControllerActionsThrowsExceptionIfFlexformConfigurationIsInvalid() {
+       public function overrideSwitchableControllerActionsThrowsExceptionIfFlexFormConfigurationIsInvalid() {
                $frameworkConfiguration = array(
                        'pluginName' => 'Pi1',
                        'extensionName' => 'SomeExtension',
@@ -282,10 +282,10 @@ class Tx_Extbase_Tests_Unit_Configuration_FrontendConfigurationManagerTest exten
                                )
                        )
                );
-               $flexformConfiguration = array(
+               $flexFormConfiguration = array(
                        'switchableControllerActions' => 'Controller1->;Controller2->action3;Controller2->action1'
                );
-               $this->frontendConfigurationManager->_call('overrideSwitchableControllerActionsFromFlexform', $frameworkConfiguration, $flexformConfiguration);
+               $this->frontendConfigurationManager->_call('overrideSwitchableControllerActionsFromFlexForm', $frameworkConfiguration, $flexFormConfiguration);
        }
 
        /**
@@ -297,11 +297,11 @@ class Tx_Extbase_Tests_Unit_Configuration_FrontendConfigurationManagerTest exten
                                'framework' => 'configuration'
                        ),
                );
-               $frontendConfigurationManager = $this->getAccessibleMock('Tx_Extbase_Configuration_FrontendConfigurationManager', array('overrideStoragePidIfStartingPointIsSet', 'overrideConfigurationFromPlugin', 'overrideConfigurationFromFlexform'));
+               $frontendConfigurationManager = $this->getAccessibleMock('Tx_Extbase_Configuration_FrontendConfigurationManager', array('overrideStoragePidIfStartingPointIsSet', 'overrideConfigurationFromPlugin', 'overrideConfigurationFromFlexForm'));
                $frontendConfigurationManager->expects($this->at(0))->method('overrideStoragePidIfStartingPointIsSet')->with($frameworkConfiguration)->will($this->returnValue(array('overridden' => 'storagePid')));
                $frontendConfigurationManager->expects($this->at(1))->method('overrideConfigurationFromPlugin')->with(array('overridden' => 'storagePid'))->will($this->returnValue(array('overridden' => 'pluginConfiguration')));
-               $frontendConfigurationManager->expects($this->at(2))->method('overrideConfigurationFromFlexform')->with(array('overridden' => 'pluginConfiguration'))->will($this->returnValue(array('overridden' => 'flexformConfiguration')));
-               $expectedResult = array('overridden' => 'flexformConfiguration');
+               $frontendConfigurationManager->expects($this->at(2))->method('overrideConfigurationFromFlexForm')->with(array('overridden' => 'pluginConfiguration'))->will($this->returnValue(array('overridden' => 'flexFormConfiguration')));
+               $expectedResult = array('overridden' => 'flexFormConfiguration');
                $actualResult = $frontendConfigurationManager->_call('getContextSpecificFrameworkConfiguration', $frameworkConfiguration);
                $this->assertEquals($expectedResult, $actualResult);
        }