[TYPO3-core] RFC: Fix bugs #3397 (submit as image) and #2938 (editIcons)

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon May 22 20:22:27 CEST 2006


Ernesto Baschny [cron IT] schrieb:
> Martin Kutschker schrieb am 22.05.2006 18:18:
> 
> Yeah, that was some ugly code we had there.
> 
> 
>>+							$image=$this->IMAGE_RESOURCE($conf['image.']);
> 
> The method is called "IMG_RESOURCE"?

Ouch!

> 
> 
>>+						if ($image)	{
>>+							$fieldCode=sprintf('<input type="image" name="%s"'.$elementIdAttribute.' src="%s" />', $confData['fieldname']);
> 
> 
> I would suggest not mixing %s with $variables in sprintf formatting.
> This was already fixed in CVS in the FORM routine. Just move the
> $elementIdAttribute the a %s instead.

Done.

> And where is the $image being placed in the <input> tag in this code
> fragment? It is missing at the end of the sprintf() call.

Ohhh, yes.

> This looks untested to me. :)

A late nite quicky ;-)

> Other than that it is probably also a "backwards compatibility" issue if
> you change this. TSref [1] documents the "image" property for the FORM
> cObject as a "IMAGE (cObject)". This makes no real sense for a submit
> button, but there might be people using properties from the IMAGE
> cObject [2] that aren't present in a IMG_RESOURCE [3].
> 
> I think only altText and titleText make sense here. You might want to
> handle those specifically in this code fragment.

I added support for "altText", "titleText" and "params". Does "if" make 
sense? I don't think so as none of the other field types are conditional.

While checking the specs for alt/title on input elements I noticed that we 
do not support any of this attributes (directly):

disabled
tabindex
accesskey
onfocus
onblur
onselect
onchange
title
style

Masi



More information about the TYPO3-team-core mailing list