[TYPO3-core] Hook request

Franz Holzinger franz at fholzinger.com
Wed Feb 15 21:54:13 CET 2006


Hello Bernhard,


>
>
> Description:
> There is already a hook to allow one to dynamically modify the DS of a
> Flexform element of
> a record. Currently I develop an extension in which you can choose at
> setup if you would like
> to use Flexform records or rather traditional TCA tables. For this
> task I require to modify the
> TCA of a table dynamically.
> I cannot do this with "bad" XCLASSes cause the only point which ever
> get's reached before the TCA
> of a table get's read is t3lib_div::loadTCA and this is a method
> called via the scope operator.
>
> The problem of performance (as loadTCA is a much used method) without
> any hook shouldn't much differ
> as it is only an if and an is_array which get's performed. For the
> case there is set such a hook I
> added a note to the hook that you should always use the & operator in
> front of a class so it gets
> instanciated as persistant object.
>
>
> Files:
> hook_t3lib_div_loadTCA.diff
>
>

this is fine. However maybe we should find a better solution to this.
This is because the loading of TCA is an important thing and needed
everywhere.

What about providing an additional parameter?

loadTCA($table,$kind='')

Then the $detail variable could be used in the tca.php files.

if ($kind == 'useFlexform') {
   $TCA['mytable'] = Array (...);
} else if ($kind == 'TCAonly') {
   $TCA['mytable'] = Array (...);
}


So you still could have all the TCA stuff for an extension in the 2 files tca.php and ext_tables.php .

Regards,

Franz











More information about the TYPO3-team-core mailing list