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

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Tue Mar 18 23:36:53 CET 2008


Steffen Kamper schrieb:
> Hi
> 
> This is an SVN patch request.
> 
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=7854
> 
> Branches: 4.2
> 
> Problem:
> having Crop Lines checked, there is no coloring and the select for coloring 
> modus disappear.
> 
> Solution:
> With this patch i allow coloring also with Crop lines, works fine.

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!


More information about the TYPO3-team-core mailing list