[TYPO3-core] RFC: Load javascript libraries

Benjamin Mack mack at xnos.org
Wed Sep 19 18:20:52 CEST 2007


Hey Olly,

thanks a lot for your feedback!

Oliver Hader wrote:
> Having a function that holds information about which JavaScript library
> was integrated is absolutely required. But I wouldn't put this to
> template.php but more to t3lib_div. The libs could also be used for
> front-end disposal - so putting this to template.php has no effect in
> that case.
Yeah, but since t3lib_div is a class with a lot of static functions, we 
cannot find out if a library is loaded already (at least not in an easy 
way ;-)). t3lib_div would need to know which document is used right now, 
if it is used for the backend /  frontend etc. I think we need two 
functions:
* One in template.php for the BE
* One in pi_base or in lib/div for the FE plugins

> With an approach storing the filepath, all files would be integrated
> together. A better one would be to extract and store only the filename,
> e.g. 'prototype.js', of the library to be loaded.
Anyway, your concern could be fixed with a "basename($libname)" solution 
to only get "prototype.js" in the array key. What do you think?

greetings,
benni.
-SDG-


More information about the TYPO3-team-core mailing list