Followup to #8014: Fixed bug with usage of t3lib_TCEforms::getDynTabMenu()
authorOliver Hader <oliver.hader@typo3.org>
Tue, 8 Apr 2008 12:33:16 +0000 (12:33 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 8 Apr 2008 12:33:16 +0000 (12:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3546 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php

index 1d6d7b0..bd6924e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-08  Oliver Hader  <oliver@typo3.org>
+
+       * Followup to #8014: Fixed bug with usage of t3lib_TCEforms::getDynTabMenu()
+
 2008-04-08  Benjamin Mack  <benni@typo3.org>
 
        * Fixed bug #8041: EM has wrong image tag for headers in extension listing (Thanks to Steffen Kamper)
index 2e25593..209eaa1 100755 (executable)
@@ -657,21 +657,19 @@ class t3lib_TCEforms      {
                                if ($content) {
                                        // Wrap content (row) with table-tag, otherwise tab/sheet will be disabled (see getdynTabMenu() )
                                        $content = '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.$content.'</table>';
-                                       $parts[$idx] = array(
-                                               'label' => $out_array_meta[$idx]['title'],
-                                               'content' => $content,
-                                               'newline' => $out_array_meta[$idx]['newline'],  // Newline for this tab/sheet
-                                       );
-                               } 
-                               
-                               
+                               }
+                               $parts[$idx] = array(
+                                       'label' => $out_array_meta[$idx]['title'],
+                                       'content' => $content,
+                                       'newline' => $out_array_meta[$idx]['newline'],  // Newline for this tab/sheet
+                               );
                        }
 
                        if (count($parts) > 1) {
                                        // Unset the current level of tab menus:
                                $this->popFromDynNestedStack('tab', $tabIdentStringMD5.'-'.($out_sheet+1));
-
-                               $output = $this->getDynTabMenu($parts, $tabIdentString, $table);
+                               $dividersToTabsBehaviour = (isset($TCA[$table]['ctrl']['dividers2tabs']) ? $TCA[$table]['ctrl']['dividers2tabs'] : 1);
+                               $output = $this->getDynTabMenu($parts, $tabIdentString, $dividersToTabsBehaviour);
 
                        } else {
                                        // If there is only one tab/part there is no need to wrap it into the dynTab code
@@ -2371,7 +2369,8 @@ class t3lib_TCEforms      {
                                }
 
                                if (is_array($dataStructArray['sheets']))       {
-                                       $item.= $this->getDynTabMenu($tabParts, 'TCEFORMS:flexform:'.$PA['itemFormElName'].$PA['_lang'], $table);
+                                       $dividersToTabsBehaviour = (isset($GLOBALS['TCA'][$table]['ctrl']['dividers2tabs']) ? $GLOBALS['TCA'][$table]['ctrl']['dividers2tabs'] : 1);
+                                       $item.= $this->getDynTabMenu($tabParts, 'TCEFORMS:flexform:'.$PA['itemFormElName'].$PA['_lang'], $dividersToTabsBehaviour);
                                } else {
                                        $item.= $sheetContent;
                                }
@@ -4066,12 +4065,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)
+        * @param       integer         If set to '1' empty tabs will be removed, If set to '2' empty tabs will be disabled
         * @return      string          HTML for the menu
         */
-       function getDynTabMenu($parts, $idString, $table) {
+       function getDynTabMenu($parts, $idString, $dividersToTabsBehaviour = 1) {
                if (is_object($GLOBALS['TBE_TEMPLATE'])) {
-                       return $GLOBALS['TBE_TEMPLATE']->getDynTabMenu($parts, $idString, 0, false, 50, 1, false, 1, $GLOBALS[$table]['ctrl']['dividers2tabs']);
+                       return $GLOBALS['TBE_TEMPLATE']->getDynTabMenu($parts, $idString, 0, false, 50, 1, false, 1, $dividersToTabsBehaviour);
                } else {
                        $output = '';
                        foreach($parts as $singlePad)   {