[BUGFIX] Add default csc-mailform DIV wrap
authorOliver Hader <oliver@typo3.org>
Wed, 19 Oct 2011 17:00:25 +0000 (19:00 +0200)
committerOliver Hader <oliver@typo3.org>
Sun, 23 Oct 2011 17:42:06 +0000 (19:42 +0200)
A new form element does not have any class settings. This issue
reintroduces stdWrap possibilites for the new form system extension.

Change-Id: Id0cff00892f2be0255d639f3bfbb7afe14ef6177
Fixes: #31120
Reviewed-on: http://review.typo3.org/6042
Reviewed-by: Steffen Ritter
Reviewed-by: Xavier Perseguers
Reviewed-by: Georg Ringer
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/form/Classes/Controller/Form.php
typo3/sysext/form/Resources/Private/Configuration/TypoScript/setup.txt

index 8bea615..f482111 100644 (file)
@@ -112,22 +112,32 @@ class tx_form_Controller_Form {
                                /** @var $typoScriptParser t3lib_tsparser */
                                $typoScriptParser = t3lib_div::makeInstance('t3lib_tsparser');
                                $typoScriptParser->parse($bodytext);
-                               $typoScript = t3lib_div::array_merge_recursive_overrule(
+                               $mergedTypoScript = t3lib_div::array_merge_recursive_overrule(
                                        (array) $typoScriptParser->setup,
                                        (array) $typoScript
                                );
 
                                // Disables content elements since TypoScript is handled that could contain insecure settings:
-                               $typoScript[tx_form_Domain_Factory_Typoscript::PROPERTY_DisableContentElement] = TRUE;
+                               $mergedTypoScript[tx_form_Domain_Factory_Typoscript::PROPERTY_DisableContentElement] = TRUE;
                        }
 
                        $newTypoScript = array(
                                '10' => 'FORM_INT',
-                               '10.' => $typoScript,
+                               '10.' => $mergedTypoScript,
                        );
 
                        $content = $contentObject->COBJ_ARRAY($newTypoScript, 'INT');
 
+                               // Only apply stdWrap to TypoScript that was NOT created by the wizard:
+                       if (isset($typoScript['stdWrap.'])) {
+                               $content = $contentObject->stdWrap(
+                                       $content,
+                                       $typoScript['stdWrap.']
+                               );
+                       }
+
+                       // The FORM_INT object is basically created with the wizard and thus
+                       // must not allow any stdWrap handling nor any custom TypoScript!
                } elseif ($typoScriptObjectName === 'FORM_INT') {
                        $this->initialize($typoScript);
                        $content = $this->execute();
index bee1c23..393f171 100644 (file)
@@ -1,7 +1,13 @@
 tt_content.mailform.20 >
 tt_content.mailform.20 = FORM
 tt_content.mailform.20 {
+       stdWrap.wrap = <div class="csc-mailform"> | </div>
+       stdWrap {
+               editIcons = tt_content: bodytext
+               editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.form
 
+               prefixComment = 2 | Mail form inserted:
+       }
 }
 
 #tt_content.login.20 >