[+BUGFIX] Extbase (Property): Fixed the property mapper by backporting the FLOW3...
authorSebastian Kurfürst <sebastian@typo3.org>
Sat, 12 Sep 2009 14:20:56 +0000 (14:20 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Sat, 12 Sep 2009 14:20:56 +0000 (14:20 +0000)
typo3/sysext/fluid/ChangeLog [deleted file]
typo3/sysext/fluid/Classes/Compatibility/DocbookGeneratorService.php
typo3/sysext/fluid/Classes/Service/DocbookGenerator.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php

diff --git a/typo3/sysext/fluid/ChangeLog b/typo3/sysext/fluid/ChangeLog
deleted file mode 100755 (executable)
index 6196bef..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-2009-03-25 Sebastian Kurfürst  <sebastian@typo3.org>
-
-       * initial code generated with kickstarter
index bbabfa4..381461e 100644 (file)
@@ -35,6 +35,12 @@ page.10.userFunc = Tx_Fluid_Compatibility_DocbookGeneratorService->userFunc
 class Tx_Fluid_Compatibility_DocbookGeneratorService extends Tx_Fluid_Service_DocbookGenerator {
 
        public function userFunc() {
+               if (!class_exists('Tx_Extbase_Utility_ClassLoader')) {
+                       require(t3lib_extmgm::extPath('extbase') . 'Classes/Utility/ClassLoader.php');
+               }
+
+               $classLoader = new Tx_Extbase_Utility_ClassLoader();
+               spl_autoload_register(array($classLoader, 'loadClass'));
                return $this->generateDocbook('Tx_Fluid_ViewHelpers');
        }
        protected function getClassNamesInNamespace($namespace) {
index 3634d9f..64d5972 100644 (file)
@@ -199,12 +199,21 @@ class Tx_Fluid_Service_DocbookGenerator {
                $argumentsTable->addChild('title', 'Arguments');
                $tgroup = $argumentsTable->addChild('tgroup');
                $tgroup['cols'] = 4;
-               $this->addArgumentTableRow($tgroup->addChild('thead'), 'Name', 'Type', 'Required', 'Description', 'Default');
+               $this->addArgumentTableRow($tgroup->addChild('thead'), 'Name', 'Type', 'Description');
 
                $tbody = $tgroup->addChild('tbody');
 
                foreach ($argumentDefinitions as $argumentDefinition) {
-                       $this->addArgumentTableRow($tbody, $argumentDefinition->getName(), $argumentDefinition->getType(), ($argumentDefinition->isRequired()?'yes':'no'), $argumentDefinition->getDescription(), $argumentDefinition->getDefaultValue());
+                       $name = $argumentDefinition->getName();
+                       if (!$argumentDefinition->isRequired()) {
+                               $name .= ' (Optional)';
+                       }
+                       $description = $argumentDefinition->getDescription();
+                       if ($argumentDefinition->getDefaultValue()) {
+                               // TODO: Is this if-condition correct!?
+                               $description .= 'Standardwert: ' . (string)$argumentDefinition->getDefaultValue();
+                       }
+                       $this->addArgumentTableRow($tbody, $name, $argumentDefinition->getType(), $description);
                }
        }
 
@@ -212,14 +221,12 @@ class Tx_Fluid_Service_DocbookGenerator {
                return $this->objectManager->getObject($className);
        }
 
-       private function addArgumentTableRow(SimpleXMLElement $parent, $name, $type, $required, $description, $default) {
+       private function addArgumentTableRow(SimpleXMLElement $parent, $name, $type, $description) {
                $row = $parent->addChild('row');
 
                $row->addChild('entry', $name);
                $row->addChild('entry', $type);
-               $row->addChild('entry', $required);
                $row->addChild('entry', $description);
-               $row->addChild('entry', (string)$default);
        }
 
        /**
index 9a42a73..d83ac4b 100644 (file)
@@ -36,7 +36,7 @@ abstract class Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper extends Tx_
         * Initialize arguments.
         *
         * @return void
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Sebastian Kurfrst <sebastian@typo3.org>
         * @api
         */
        public function initializeArguments() {
@@ -51,7 +51,7 @@ abstract class Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper extends Tx_
         * Either returns arguments['name'], or the correct name for Object Access.
         *
         * @return string Name
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Sebastian Kurfrst <sebastian@typo3.org>
         * @author Robert Lemke <robert@typo3.org>
         * @author Karsten Dambekalns <karsten@typo3.org>
         * @author Bastian Waidelich <bastian@typo3.org>
@@ -70,7 +70,7 @@ abstract class Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper extends Tx_
                if ($this->arguments->hasArgument('value') && is_object($this->arguments['value'])) {
                        if (NULL !== $this->persistenceManager->getBackend()->getIdentifierByObject($this->arguments['value'])
                                && (!$this->persistenceManager->getBackend()->isNewObject($this->arguments['value']))) {
-                               $name .= '[uid]';
+                               $name .= '[__identity]';
                        }
                }
                return $this->prefixFieldName($name);
@@ -81,7 +81,7 @@ abstract class Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper extends Tx_
         * Either returns arguments['value'], or the correct value for Object Access.
         *
         * @return mixed Value
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Sebastian Kurfrst <sebastian@typo3.org>
         * @author Robert Lemke <robert@typo3.org>
         * @author Bastian Waidelich <bastian@typo3.org>
         */
@@ -120,7 +120,7 @@ abstract class Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper extends Tx_
         * Internal method which checks if we should evaluate a domain object or just output arguments['name'] and arguments['value']
         *
         * @return boolean TRUE if we should evaluate the domain object, FALSE otherwise.
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @author Sebastian Kurfrst <sebastian@typo3.org>
         */
        protected function isObjectAccessorMode() {
                return $this->arguments->hasArgument('property')