[TYPO3-core] RFC: #6259 Disabling Tabs with no fields (does not work)

Bernhard Kraft kraftb at kraftb.at
Sat Nov 17 14:56:23 CET 2007


Malte Jansen wrote:
> Hi the 2nd ;)

Hi Malte !


I saw you are concerning about my "hideEmtpyDynTabs" patch ...

You suggested as patch:

---------------------------------------------------------------------------------------------------------
--- D:/workspace-typo3/typo3/typo3_src-svn/t3lib/class.t3lib_tceforms.php	(revision 2610)
+++ D:/workspace-typo3/typo3/typo3_src-svn/t3lib/class.t3lib_tceforms.php	(working copy)
@@ -631,11 +631,13 @@
  				// Create parts array for the tab menu:
  			$parts = array();
  			foreach ($out_array as $idx => $sheetContent)	{
+				$sContent = implode('',$sheetContent);
+				if (!empty($sContent)) {
+					$sContent = '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.$sContent.'</table>';
+				}
  				$parts[] = array(
  					'label' => $out_array_meta[$idx]['title'],
-					'content' => '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
-							implode('',$sheetContent).
-						'</table>'
+					'content' => $sContent,
  				);
  			}
---------------------------------------------------------------------------------------------------------

But this is mostly like it is done currently:

The array is only added to $parts when there is something set:

---------------------------------------------------------------------------------------------------------
          foreach ($out_array as $idx => $sheetContent)   {
             $resstr = implode('', $sheetContent);
             if ($resstr) {
                $parts[$idx] = array(
                   'label' => $out_array_meta[$idx]['title'],
                   'content' => '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
                         $resstr.
                      '</table>',
                   'newline' => $out_array_meta[$idx]['newline'],  // Newline for this tab/sheet
                );
             }
          }
---------------------------------------------------------------------------------------------------------

Probably it is required to add a trim() around $resstr;

I guess you are looking at an old version of the SVN source :( :( ....


I'll try to contact you via skype or similar ...


greets,
Bernhard


More information about the TYPO3-team-core mailing list