[TYPO3-core] RFC: fix bug #1801 (no real read-only TCA field)

Martin Kutschker Martin.Kutschker at blackbox.net
Sun Jan 8 12:41:40 CET 2006


This is a CVS patch request.

Problem: TCA doesn't support read-only fields out-of-the-box except plain text fields. If you need custom types, even simple ones, you must use a custom fucntion with type "user".

Solution: Enhance type "none" with a set of useful types and formatting options.

Description: This patch adds the config option "format". It takes precedence before "rows". "format" takes a comma delited string witn formating options: <type>,<option>. The syntax of option depends on the type. Some of the types are there to have a compatible syntax to "eval" of type "input".

date[,<date() format string] = timestamp with default d-m-Y
datetime = timestamp with i:H d-m-Y
dateage = timestamp with d-m-Y and a trailing age in brackets
year = timestamp, only year shown
time[,<strftime() format string] = timestamp with default %M:%H
timesec = timestamp with default %M:%H:%S
int[,dec|hex|oct|bin] = integer field, decimal output is default
float[,precision] = floating point field, default precision of 2
md5 = md5 hash (hide values, but make content comparable]
user[,<function>[,args]] = a user function

As an alternative we could use format.option and the occasional extra argument for some types.

So we could have, eg:

format = date
format.option = d-m-y
format.age = 1

format = user
format.option = <userfunc>
format.args = blah

The user function type is not really necessary as you can use type "user". But IMHO it's a bit cleaner as type "user" implies a field with input capabilities, while type "none" and subtype "user" makes it clear that it is a read-only field.

Any comments? I think that the types and the configuration (string vs attribute) need some discussion.

Masi

PS: I have also removed the dead-code that had a default of 5 rows.

PPS: The Core API doc has an errors. The description of type has "[Must be set to "" (blank string!)]", but should read "[Must be set to "none"]".

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-diff
Size: 3244 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060108/d398f441/attachment.bin 


More information about the TYPO3-team-core mailing list