[TASK] (ViewHelper): Code Cleanup to AbstractFormField ViewHelper
authorSebastian Kurfuerst <sebastian@typo3.org>
Sun, 19 Jun 2011 08:28:01 +0000 (10:28 +0200)
committerSebastian Kurfuerst <sebastian@typo3.org>
Mon, 20 Jun 2011 08:17:10 +0000 (10:17 +0200)
Change-Id: If9f1d413d0061238807b6526bb1471714dc57250

typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php

index b75f376..4f5ff73 100644 (file)
@@ -58,6 +58,20 @@ abstract class Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper extends Tx_
         * @author Bastian Waidelich <bastian@typo3.org>
         */
        protected function getName() {
+               $name = $this->getNameWithoutPrefix();
+               return $this->prefixFieldName($name);
+       }
+
+       /**
+        * Get the name of this form element, without prefix.
+        *
+        * @return string name
+        * @author Sebastian Kurf├╝rst <sebastian@typo3.org>
+        * @author Robert Lemke <robert@typo3.org>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        * @author Bastian Waidelich <bastian@typo3.org>
+        */
+       protected function getNameWithoutPrefix() {
                if ($this->isObjectAccessorMode()) {
                        $formObjectName = $this->viewHelperVariableContainer->get('Tx_Fluid_ViewHelpers_FormViewHelper', 'formObjectName');
                        if (!empty($formObjectName)) {
@@ -79,7 +93,8 @@ abstract class Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper extends Tx_
                                $name .= '[__identity]';
                        }
                }
-               return $this->prefixFieldName($name);
+
+               return $name;
        }
 
        /**