[TYPO3-core] RFC #9613: RTE uses JScodeLibArray to insert CSS

Oliver Hader oliver at typo3.org
Thu Oct 23 10:37:33 CEST 2008


Hi Stan,

Stanislas Rolland schrieb:
> Stanislas Rolland a écrit :
>>
>> Solution:
>> The attached patch adds array $additionalHeaderData to class template,
>> and uses it to add the additional head section content needed by the
>> RTE. $GLOBALS['TSFE']->additionalHeaderData is used instead when
>> available.
>>
> Attaching a better patch for trunk.
> 
> This patch adds method addStyleSheet($key, $href, $title, $linkType)
> to class template. The method is then wrapped by t3lib_TCEforms,
> redefined in t3lib_TCEforms_FE in order to use the TSFE array. Similar
> method is added to rtehtmlarea_base and tx_rtehtmlarea_pi2 (frontend use
> of the RTE).

Thanks for the quick patch!

The CSS files get loaded in front-end now, however it still looks
strange somehow (see the attached screenshot which shows the TCEforms
spread from left to right - however it's not related to RTEhtmlarea).

Some annotations to the patch:

Line 19 (and all occurences of the new method "addStyleSheet"):
* $title should be an optional parameter
* $linkType should be called $relation or $relationType (since the
"type" attribute of the "link" tag would be "text/css")

Lines 77 and 96:
You're changing from "getPageStyle" to "addPageStyle" - however, these
methods are also available in TYPO3 4.2. Do you think someone had
xclassed them and will run into problems? IMO I think it's not the case,
but wanted to clearify it...

Line 202:
Define the new variable $additionalStyleSheets as protected, please.

Line 231:
If data for the same key gets added twice but with diferent files ($href
argument) it will be overriden. I'd tend to have a "first wins"
principle and thus a  "if (!isset($this->additionalStyleSheets[$key]))"
around it. What do you think?

+1 on reading if you could take the mentioned things into account. Thanks!


olly
-- 
Oliver Hader
TYPO3 4.3 Release Manager
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9613_test.png
Type: image/png
Size: 23250 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20081023/f6bdf77a/attachment-0001.png 


More information about the TYPO3-team-core mailing list