[TYPO3-core] RFC: #7891: Docheader Class with Hook for dynamic change of docheaders

Tapio Markula tapio.markula at xetpoint.fi
Tue Mar 25 16:01:08 CET 2008


Martin Kutschker kirjoitti:
> Tapio Markula schrieb:
>> Tapio Markula
>>> Please look my proposal - it has a hook and it allows very flexible 
>>> configuration
>>
>> my previos patch didn't have exaclty the code style, which core team 
>> requires. New patch has the same code style as Typo3 in general.
>> No functionality changes.
> 
>>                  // replace the marker with the template and remove 
>> all line breaks (for IE compat)
>> -            $markers['BUTTONLIST_' . strtoupper($key)] = 
>> str_replace("\n", '', $buttonTemplate);
>> -        }
>> +            $markers['BUTTONLIST_' . strtoupper($key)] = 
>> str_replace("\n", '', $buttonList);
>> +         }
> 
> 
> Just hopping into this thread.
> 
> Please use t3lib_div::strtoupper(). One never knows if for some reason a 
> Turkish locale is in effect.

ok. The same issue was in the original template.php
The patch proposal has a problem with default values
public function moduleBody($pageRecord = array(), $buttons = array(), 
$markerArray = array(), $page='', $leftButtonsGroupString='foo', 
$rightButtonsGroupString='foo') {

I put 'foo' because good configuration might have '' and
it is not possible to test using boolean test because '' gives false.
In this case value '' could *not* be used as default value,
because the parameter is not necessarily needed and value ''
would cause incorrect configuration.

Nobody set 'foo' as value and I used that in test

if($page && $leftButtonsGroupString!='foo')

but should I rather use $leftButtonsGroupString=NULL and
test
if($page && !is_null($leftButtonsGroupString))



More information about the TYPO3-team-core mailing list