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

Tapio Markula tapio.markula at xetpoint.fi
Sat Nov 17 14:37:42 CET 2007


Malte Jansen kirjoitti:
> Hi,
> that's true. So here is the new patch...
> 
> Cheers,
> 
> Malte
> 
> Tapio Markula schrieb:
>> Malte Jansen kirjoitti:
>>>
>>> Ingmar Schlecht schrieb:
>>>> Hi Malte,
>>>>
>>>> Malte Jansen schrieb:
>>>>>> I'm actually in favour of completely removing them always when 
>>>>>> they're
>>>>>> empty. What do you think?
>>>>>>
>>>>> So my idea would be, that div2tabs has one addition option:
>>>>> divs2tabs = 0 (off)
>>>>> divs2tabs = 1 (activ I)
>>>>> divs2tabs = 2 (activ II)
>>>>
>>>> Sounds reasonable.
>>>>
>>>> Can you prepare a patch and the necessary documentation changes?
>>>>
>>>> cheers
>>>> Ingmar
>>>>
>>>
>>> Hi,
>>> here is the new patch.
>>>
>>> Cheers,
>>>
>>> Malte
>>>
>>
>> should rather be
>>
>>
>>                 $isEmpty = strcmp(trim($def['content']),'');
>>                     // "Removes" empty tabs
>>                 if (!$isEmpty && $dividers2tabs == 1) {
>>                     continue;
>>                 }
>> endeed the variable should be rather $isNonEmpty, when it has more sense
>>
>> $isNonEmpty = strcmp(trim($def['content']),'');
>>                     // "Removes" empty tabs
>>                 if (!$isNonEmpty && $dividers2tabs == 1) {
>>                     continue;
>> ...
>> <td class="'.($isNonEmpty ? 'tab' : 'disabled')...
>>                 }

In fact it would be better to separate this function as own function

as generic class file into t3lib
class.t3lib_dyntabmenu.php

in template.php would be just reference

function 
getDynTabMenu($menuItems,$identString,$toggle=0,$foldout=FALSE,$newRowCharLimit=50,$noWrap=1,$fullWidth=FALSE,$defaultTabIndex=1,$dividers2tabs=1) 
{
	 
t3lib_dynTabMenu::getDynTabMenu($menuItems,$identString,$toggle,$foldout,$newRowCharLimit,$noWrap,$fullWidth,$defaultTabIndex,$dividers2tabs);
	}

in t3lib_tceforms.php could use also references to this function.
JavaScript could be externa JS-file and as compatibility reasons the 
function could be
/**
	 * Returns dynamic tab menu header JS code.
	 *
	 * @return	string		JavaScript section for the HTML header.
	 */
	function getDynTabMenuJScode()	{
		return '<script type="text/javascript" 
src="'.t3lib_div::getIndpEnv('TYPO3_SITE_URL').PATH_t3lib.'getDynTabMenuJScode.js"></script>'; 
	
		}

with that path it should work both in backend and frontend.

I try to create patch proposal to use function getDynTabMenu in all 
situations
* backend
* frontend editing
* frontend plugins


More information about the TYPO3-team-core mailing list