[TYPO3] t3lib_TCEmain hook processCmdmap_postProcess
Sander van Gelderen
mail at sandervangelderen.nl
Thu May 31 15:28:13 CEST 2007
Hello list,
I am trying to make use of the processCmdmap_postProcess hook in class t3lib_TCEmain, but no luck yet.
I created an extension (key: svgfoobar) with kickstarter, it has two tables and a FE plugin.
The plugin is not 'Add to Insert Plugin list in Content Elements' as I have used until now, but 'Add
as a totally new Content Element type'. This seems to work fine, I get a very nice 'Hello world!'
and TypoScript passed to the method is shown correctly.
The result I am trying to achieve: If a user updates a record from one of my tables in Web>List, the
record should be moved to a different sysFolder (depending on the change made to a certain field in
the record).
Here is where I am with it at the moment:
1) I have created a class (tx_svgfoobar_tcemain) in the root of my ext folder, it contains the
following:
class tx_svgfoobar_tcemain {
function processCmdmap_postProcess($command, $table, $id, $value, &$reference) {
t3lib_div::devLog ('processCmdmap_postProcess', 'svgfoobar', 0, array ($command, $table, $id, $value));
}
}
Only trying to get some debug output for now, I intend to use $tce->process_cmdmap(); for moving the
record once I get past this first hurdle. I have cc_devlog installed.
2) in my ext localconf.php I add the following lines:
require_once(t3lib_extMgm::extPath('svgfoobar').'class.tx_svgfoobar_tcemain.php');
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][]
= 'EXT:svgfoobar/class.tx_svgfoobar_tcemain.php:tx_svgfoobar_tcemain';
I am uncertain that the include_once line is in the correct place?
3) in the configuration tool ($TYPO3_CONF_VARS), I can see my class, it is sitting under templavoila
entry (which I am copying from as much as possible)
The Problem: No output from my class in DevLog, in fact the only entries in there are from
t3lib_userAuth.
Questions:
1) Is this the right approach in the first place?
2) How can I get it to work?
TIA,
Sander
More information about the TYPO3-english
mailing list