[TYPO3-core] RFC: Fix bugs #3397 (submit as image) and #2938 (editIcons)
Ernesto Baschny [cron IT]
ernst at cron-it.de
Mon May 22 19:54:17 CEST 2006
Martin Kutschker schrieb am 22.05.2006 18:18:
> Problem 1: graphical submit is rendered with IMAGE and a str_replace
> which leaves unwanted image attributes in the input element. Can be
> solved by using IMG_RESOURCE.
Yeah, that was some ugly code we had there.
> + $image=$this->IMAGE_RESOURCE($conf['image.']);
The method is called "IMG_RESOURCE"?
> + 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.
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.
This looks untested to me. :)
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. And you have to correct
TSref from:
->IMAGE (cObject)
to:
->IMG_RESOURCE (cObject)
+.altText (stdWrap)
+.titleText (stdWrap)
So that it is backwards compatible and correctly documented.
> Problem 2: editIcons have two title attributes (one is hard coded to
> en empty string). Can be solved by removing the empty attribute.
+1 for this.
Cheers,
Ernesto
[1]
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/8/20/
[2]
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/8/6/
[3]
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/8/7/
More information about the TYPO3-team-core
mailing list