[TYPO3-core] RFC: Feature request 4006 (Load $GLOBALS['TSFE'] with image dimensions when IMG_RESOURCE is used)
Ernesto Baschny [cron IT]
ernst at cron-it.de
Mon Jan 8 11:51:53 CET 2007
Dmitry Dulepov wrote: on 08.01.2007 11:24:
> This is SVN patch request.
>
> Branch: trunk
>
> Problem (quote from BT): "As documented in the TSref, the IMAGE cObject
> loads $GLOBALS['TSFE']->lastImageInfo with the height, width and url of
> the image. This would be a very useful addition to the IMG_RESOURCE
> object as well--especially for dynamically generating CSS--specifically
> for generating background properties."
>
> Solution: do the same for IMG_RESOURCE as for IMAGE. Very simple and
> safe to get into 4.1...
Sounds nice and easy.
> * @see getImgResource()
> */
> function IMG_RESOURCE($conf) {
> - $imgArray = $this->getImgResource($conf['file'],$conf['file.']);
> - return $this->stdWrap($imgArray[3],$conf['stdWrap.']);
> + $GLOBALS['TSFE']->lastImgResourceInfo = $this->getImgResource($conf['file'],$conf['file.']);
> + return $this->stdWrap($GLOBALS['TSFE']->lastImgResourceInfo[3],$conf['stdWrap.']);
> }
+1, but untested, as I don't have any use-case for that.
Cheers,
Ernesto
More information about the TYPO3-team-core
mailing list