[TYPO3-core] RFC: readonly field rendering

René Fritz rene at typo3.org
Thu Feb 9 16:45:29 CET 2006


This is a CVS patch request

Type: feature

Branch: TYPO3_4-0


This adds the possiblity to set TCEForm items to read-only. The fields should 
display the data like the editable variants (date rendered as date - not as 
integer).
You can imagine that "readonly" might be set at runtime without the need to 
change the type of the field.
It is implemented by setting form elements disabled="disabled" which works in 
Mozilla, IE, Konqueror. Some fields were just renered as type="none". And 
sometimes parts are simply not rendered (eg. element browser link).
Hidden form fields for submitting form values are not rendered.

The solution <input disabled="disabled" is not totally safe but hey, I can 
manipulate POST data anyway when I really want ...


Example:

"starttime" => Array (
	"exclude" => 1,
	"label" => "LLL:EXT:lang/locallang_general.php:LGL.starttime",
	"config" => Array (
		"type" => "input",
		"readonly" => 1, #####
		"size" => "8",
		"max" => "20",
		"eval" => "date",
		"default" => "0",
		"checkbox" => "0"
	)
),


Attached is 
- patch
- screenshot of readonly rendering
- test extension (append &readonly=1 to alt_doc.php url to set the fields to 
readonly)



Documentation:
http://typo3.org/documentation/document-library/doc_core_api/columns_fieldnam-1/

Key
	readonly

Datatype
	boolean

Description
	If set the form field will be rendered in a way that the user can see the 
values but can't edit them. The rendering is similar to the editable variants 
but not neccesarily the same and might differ in layout and size.

Scope
	Display



René

-- 
René Fritz
TYPO3 Association - Active Member
http://association.typo3.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t3lib_tceforms-readonly.patch
Type: text/x-diff
Size: 31465 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060209/952a51cd/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmphoto1.png
Type: image/png
Size: 79179 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060209/952a51cd/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ext-testform.zip
Type: application/x-zip
Size: 28086 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060209/952a51cd/attachment-0001.bin 


More information about the TYPO3-team-core mailing list