[TYPO3-core] RFC: #7860: Coloring in TS Object Browser depends on "Crop Lines"

Jeff Segars jsegars at alumni.rice.edu
Mon May 19 21:11:55 CEST 2008


Steffen Kamper wrote:
> "Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb im 
> Newsbeitrag 
> news:mailman.1.1205879814.17672.typo3-team-core at lists.netfielders.de...
>> No it doesn't.
>>
>> The cropping is done when the values have still the constant markers (eg
>> ##6fb6de_B##) applied to it. So a large constant may loose it's closing
>> marker, which will lead to a missing, yikes, closing font tag.
>>
>> A solution is to check if a value has crop markers like that in
>> t3lib/class.t3lib_tsparser_ext.php:
>>
>> if (strncmp($theValue,'##'.$this->Cmarker.'_B##',12)) {
>>  $theValue = $this->ext_fixed_lgd($theValue,$lgdChars);
>> } else {
>>   // crop "real" value and re-apply constant markers
>>  $theValue =
>> '##'.$this->Cmarker.'_B##'.$this->ext_fixed_lgd(substr($theValue,12,-12),$lgdChars).'##'.$this->Cmarker.'_E##';
>> }
>>
>> This worked for me but is a bit whacky. OTOH the crop feature isn't very
>> clean implemented itself.
>>
>> Masi
>>
>> PS: t3lib/class.t3lib_tsparser_ext.php::ext_fixed_lgd() is buggy as it
>> doesn't use use t3lib_cs->crop or t3lib_div::fixed_lgd_cs() for
>> cropping. UTF-8 characters may be destroyed!
> 
> right,  i didn't looked to htmlsource.
> 
> So i followed your proposal. I changed it only in function ext_fixed_lgd, 
> see attached patch.
> 
> i hope to be right that also with utf8 the marker-length is 12,
> the cropping i did with t3lib_div::fixed_lgd_cs() .
> What is missing is a tooltip for the tags and replacing font-tags with span. 
> There are also <br>s in it, but this has to be cleaned in 4.3
> 
> vg  Steffen 

+1 based on reading and testing.  I'll commit in a few minutes...

Thanks,
Jeff


More information about the TYPO3-team-core mailing list