[FEATURE] Integrate Forms Wizard TEXTBLOCK multiline support 90/42890/5
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Fri, 28 Aug 2015 09:42:46 +0000 (11:42 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 29 Aug 2015 12:55:43 +0000 (14:55 +0200)
The content element TEXTBLOCK is only rendered as single
line input field in the wizard. It will be difficult to add more than just a
one-liner there.
This change adds the possibility to define a multiline element in
the backend wizard. Line breaks are automatically converted to <br>
tags in the frontend.

Resolves: #31100
Releases: master
Change-Id: Ie5357d2cc308eff151f71fdaa9ffdb83796be58d
Reviewed-on: http://review.typo3.org/42890
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/form/Classes/Domain/Model/Element/TextblockElement.php
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Content/Textblock.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options/Forms/Various.js

index b0ca399..5f1dc98 100644 (file)
@@ -19,4 +19,12 @@ namespace TYPO3\CMS\Form\Domain\Model\Element;
  */
 class TextblockElement extends \TYPO3\CMS\Form\Domain\Model\Element\AbstractPlainElement {
 
+       /**
+        * Gets the data.
+        *
+        * @return string
+        */
+       public function getData() {
+               return nl2br($this->getContent());
+       }
 }
index 53eed75..2d8a6e6 100644 (file)
@@ -23,7 +23,7 @@ TYPO3.Form.Wizard.Elements.Content.Textblock = Ext.extend(TYPO3.Form.Wizard.Elem
                '<div class="overflow-hidden">',
                        '<tpl for="various">',
                                '<div {[this.getAttributes(parent.attributes)]}>',
-                               '{content}',
+                               '{content:nl2br}',
                                '</{type}>',
                        '</tpl>',
                '</div>',
index e031296..074bcf0 100644 (file)
@@ -66,12 +66,17 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Various = Ext.extend(Ext.FormPanel
                                case 'content':
                                        formItems.push({
                                                fieldLabel: TYPO3.l10n.localize('various_properties_content'),
+                                               xtype: 'textarea',
                                                name: 'content',
                                                allowBlank: false,
                                                listeners: {
                                                        'triggerclick': {
                                                                scope: this,
                                                                fn: this.storeValue
+                                                       },
+                                                       'blur': {
+                                                               scope: this,
+                                                               fn: this.storeValue
                                                        }
                                                }
                                        });