Fixed bug #15512: htmlArea RTE: Initialization in flexforms broken with TYPO3 4.4
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 25 Sep 2010 22:31:45 +0000 (22:31 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 25 Sep 2010 22:31:45 +0000 (22:31 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-4@8898 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index b3597c0..f933070 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
        * Follow-up to bug #15430: htmlArea RTE: Text not editable after pasting with server-based cleaning
        * Fixed bug #15797: htmlArea RTE: Problem in Firefox inserting non-breaking space with Insert Special Character dialogue
        * Fixed bug #15749: htmlArea RTE: Firefox shows &amp; in external links with query string
+       * Fixed bug #15512: htmlArea RTE: Initialization in flexforms broken with TYPO3 4.4
 
 2010-09-25  Steffen Gebert  <steffen@steffen-gebert.de>
 
index 6506bb4..15cffcd 100644 (file)
@@ -2542,6 +2542,11 @@ class t3lib_TCEforms     {
                                                $PA['_lang'] = $lang;
                                                $PA['_cshFile'] = ((isset($dataStruct['ROOT']['TCEforms']) && isset($dataStruct['ROOT']['TCEforms']['cshFile'])) ? $dataStruct['ROOT']['TCEforms']['cshFile'] : '');
 
+                                                       // Push the sheet level tab to DynNestedStack
+                                               if (is_array($dataStructArray['sheets'])) {
+                                                       $tabIdentString = $GLOBALS['TBE_TEMPLATE']->getDynTabMenuId('TCEFORMS:flexform:' . $PA['itemFormElName'] . $PA['_lang']);
+                                                       $this->pushToDynNestedStack('tab', $tabIdentString . '-' . (count($tabParts)+1));
+                                               }
                                                        // Render flexform:
                                                $tRows = $this->getSingleField_typeFlex_draw(
                                                                        $dataStruct['ROOT']['el'],
@@ -2557,6 +2562,11 @@ class t3lib_TCEforms     {
 
                        #                       $item = '<div style=" position:absolute;">'.$item.'</div>';
                                                //visibility:hidden;
+
+                                                       // Pop the sheet level tab from DynNestedStack
+                                               if (is_array($dataStructArray['sheets'])) {
+                                                       $this->popFromDynNestedStack('tab', $tabIdentString . '-' . (count($tabParts)+1));
+                                               }
                                        } else $sheetContent='Data Structure ERROR: No ROOT element found for sheet "'.$sheet.'".';
 
                                                // Add to tab:
@@ -2797,6 +2807,9 @@ class t3lib_TCEforms      {
                                                        $s = t3lib_div::revExplode('[]',$formPrefix,2);
                                                        $actionFieldName = '_ACTION_FLEX_FORM'.$PA['itemFormElName'].$s[0].'][_ACTION]['.$s[1];
 
+                                                               // Push the container to DynNestedStack as it may be toggled                                                    
+                                                       $this->pushToDynNestedStack('flex' , $idTagPrefix);
+
                                                                // Putting together the container:
                                                        $this->additionalJS_delete = array();
                                                        $output.= '
@@ -2821,6 +2834,9 @@ class t3lib_TCEforms      {
                                                                </div>';
                                                        $output = str_replace('/*###REMOVE###*/', t3lib_div::slashJS(htmlspecialchars(implode('', $this->additionalJS_delete))), $output);
                                                                        // NOTICE: We are saving the toggle-state directly in the flexForm XML and "unauthorized" according to the data structure. It means that flexform XML will report unclean and a cleaning operation will remove the recorded togglestates. This is not a fatal problem. Ideally we should save the toggle states in meta-data but it is much harder to do that. And this implementation was easy to make and with no really harmful impact.
+
+                                                               // Pop the container from DynNestedStack
+                                                       $this->popFromDynNestedStack('flex' , $idTagPrefix);
                                                }
 
                                                // If it's a "single form element":
index 38f5bbd..57baa46 100644 (file)
@@ -4,6 +4,7 @@
        * Follow-up to bug #15430: htmlArea RTE: Text not editable after pasting with server-based cleaning
        * Fixed bug #15797: htmlArea RTE: Problem in Firefox inserting non-breaking space with Insert Special Character dialogue
        * Fixed bug #15749: htmlArea RTE: Firefox shows &amp; in external links with query string
+       * Fixed bug #15512: htmlArea RTE: Initialization in flexforms broken with TYPO3 4.4
 
 2010-09-12  Stanislas Rolland  <typo3@sjbr.ca>
 
index a1a42fb..362f2c2 100644 (file)
@@ -2794,10 +2794,16 @@ HTMLArea.util.TYPO3 = function () {
                                for (i=0, max=nested.length; i<max; i++) {
                                        type = nested[i][0];
                                        level = nested[i][1];
-                                       if (type=='tab') {
-                                               simplifiedNested.push(level+'-DIV');
-                                       } else if (type=='inline') {
-                                               simplifiedNested.push(level+'_fields');
+                                       switch (type) {
+                                               case 'tab':
+                                                       simplifiedNested.push(level+'-DIV');
+                                                       break;
+                                               case 'inline':
+                                                       simplifiedNested.push(level+'_fields');
+                                                       break;
+                                               case 'flex':
+                                                       simplifiedNested.push(level+'-content');
+                                                       break;
                                        }
                                }
                        }