Fixed bug #7634: Tabs disappear when BE-editing a record that contains IRRE
authorOliver Hader <oliver.hader@typo3.org>
Mon, 17 Mar 2008 14:39:12 +0000 (14:39 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 17 Mar 2008 14:39:12 +0000 (14:39 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3449 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php

index fde073c..87455be 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-03-17  Oliver Hader  <oliver@typo3.org>
 
        * Fixed bug #4186: GIFBUILDER cropsized images have bad quality
+       * Fixed bug #7634: Tabs disappear when BE-editing a record that contains IRRE
 
 2008-03-17  Jeff Segars  <jeff@webempoweredchurch.org>
 
index 7aa9651..50924f7 100755 (executable)
@@ -230,7 +230,6 @@ class t3lib_TCEforms        {
        var $localizationMode='';                       // If true, the forms are rendering only localization relevant fields of the records.
        var $fieldOrder='';                                     // Overrule the field order set in TCA[types][showitem], eg for tt_content this value, 'bodytext,image', would make first the 'bodytext' field, then the 'image' field (if set for display)... and then the rest in the old order.
        var $doPrintPalette=1;                          // If set to false, palettes will NEVER be rendered.
-       var $dividers2tabs=0;                           // Will be set to TCA[ctrl][dividers2tabs]
 
        /**
         * Set to initialized clipboard object; Then the element browser will offer a link to paste in records from clipboard.
@@ -500,8 +499,8 @@ class t3lib_TCEforms        {
                                // Load the full TCA for the table.
                        t3lib_div::loadTCA($table);
 
-                       // Loads the dividers2tabs from the $TCA
-                       $this->dividers2tabs = $TCA[$table]['ctrl']['dividers2tabs'];
+                               // Get dividers2tabs setting from TCA of the current table:
+                       $dividers2tabs =& $TCA[$table]['ctrl']['dividers2tabs'];
 
                                // Load the description content for the table.
                        if ($this->edit_showFieldHelp || $this->doLoadTableDescr($table))       {
@@ -527,7 +526,7 @@ class t3lib_TCEforms        {
                                                // If TCEforms will render a tab menu in the next step, push the name to the tab stack:
                                        $tabIdentString = '';
                                        $tabIdentStringMD5 = '';
-                                       if (strstr($itemList, '--div--') !== false && $this->enableTabMenu && $this->dividers2tabs) {
+                                       if (strstr($itemList, '--div--') !== false && $this->enableTabMenu && $dividers2tabs) {
                                                $tabIdentString = 'TCEforms:'.$table.':'.$row['uid'];
                                                $tabIdentStringMD5 = $GLOBALS['TBE_TEMPLATE']->getDynTabMenuId($tabIdentString);
                                                        // Remember that were currently working on the general tab:
@@ -575,7 +574,7 @@ class t3lib_TCEforms        {
                                                                if ($cc>0)      {
                                                                        $out_array[$out_sheet][$out_pointer].=$this->getDivider();
 
-                                                                       if ($this->enableTabMenu && $this->dividers2tabs)       {
+                                                                       if ($this->enableTabMenu && $dividers2tabs) {
                                                                                $this->wrapBorder($out_array[$out_sheet],$out_pointer);
                                                                                        // Remove last tab entry from the dynNestedStack:
                                                                                $out_sheet++;
@@ -670,7 +669,7 @@ class t3lib_TCEforms        {
                                        // Unset the current level of tab menus:
                                $this->popFromDynNestedStack('tab', $tabIdentStringMD5.'-'.($out_sheet+1));
 
-                               $output = $this->getDynTabMenu($parts, $tabIdentString);
+                               $output = $this->getDynTabMenu($parts, $tabIdentString, $table);
 
                        } else {
                                        // If there is only one tab/part there is no need to wrap it into the dynTab code
@@ -2335,7 +2334,7 @@ class t3lib_TCEforms      {
                                }
 
                                if (is_array($dataStructArray['sheets']))       {
-                                       $item.= $this->getDynTabMenu($tabParts,'TCEFORMS:flexform:'.$PA['itemFormElName'].$PA['_lang']);
+                                       $item.= $this->getDynTabMenu($tabParts, 'TCEFORMS:flexform:'.$PA['itemFormElName'].$PA['_lang'], $table);
                                } else {
                                        $item.= $sheetContent;
                                }
@@ -4030,11 +4029,12 @@ class t3lib_TCEforms    {
         *
         * @param       array           Parts for the tab menu, fed to template::getDynTabMenu()
         * @param       string          ID string for the tab menu
+        * @param       string          Name of the table to get the tab menu for (must not be empty) 
         * @return      string          HTML for the menu
         */
-       function getDynTabMenu($parts, $idString) {
-               if (is_object($GLOBALS['TBE_TEMPLATE']))        {
-                       return $GLOBALS['TBE_TEMPLATE']->getDynTabMenu($parts, $idString, 0, FALSE, 50, 1, FALSE, 1, $this->dividers2tabs);
+       function getDynTabMenu($parts, $idString, $table) {
+               if (is_object($GLOBALS['TBE_TEMPLATE'])) {
+                       return $GLOBALS['TBE_TEMPLATE']->getDynTabMenu($parts, $idString, 0, false, 50, 1, false, 1, $GLOBALS[$table]['ctrl']['dividers2tabs']);
                } else {
                        $output = '';
                        foreach($parts as $singlePad)   {