Feature #15164
closed
HOOK before TCEform is rendered
Added by Thomas Hempel about 19 years ago.
Updated over 18 years ago.
Description
Hi,
In order to implement my dynaflex extension a little bit more elegant, it would be nice to have a hook that can be called before the TCEform is rendered.
The best would be, if the hook is available right after the TCA for the element is loaded.
Is this possible for the next version (4.0) and do you need a patch for that?
Greets and thanks in advance,
Thomas
(issue imported from #M1746)
Files
Hi,
it would be great if you could attach a patch for the hook here.
Thanks,
Sebastian
Hi Sebastian,
here it is. ;-) This patch adds two hooks to the method "getMainFields" in the tceforms class.
The hook class is called "getMainFieldsClass" so hooks can be registered with a line like this in the ext_localconf.php: $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'][] = 'EXT:my_extkey/class.tx_myextkey_tcehooks.php:tx_myextkey_tcehooks';
The hooks are called "getMainFields_preProcess" which are called before the form is rendered and "getMainFields_postProcess" which is called afterwards.
Both methods get the same arguments:
TCA: the current TCA (passed by reference!!!)
table: the name of the table of the content record
row: the current DB record (passed by reference!!!)
pObj: the TCEforms object
I Hope I got the right position for this hook. ;-)
Greets,
Thomas
Also available in: Atom
PDF