[TYPO3-dev] Pre or post processing data map
Tapio Markula
tapio.markula at atwebteam.com
Fri Oct 27 10:33:58 CEST 2006
Hi
In order to force saving form fields with certain values (in my case
field 'hidden'), the most reasonable way is using pre or post
processing using hook for class.tx_t3lib_tcemain.php
I took hook definition from another plugin and tried to use
following in my extension
require_once(t3lib_extMgm::extPath($_EXTKEY).'class.tx_t3lib_tcemain.php');
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]
= 'tx_t3lib_tcemain_process_datamap';
...
and hook file
/**
* Hook for pre processing the incoming fieldArray
*
* @param array Incoming field array
* @param string Table
* @param integer UID
* @param object Calling (Parent) Object
* @return void
*/
function processDatamap_preProcessFieldArray(&$incomingFieldArray,
$table, $id, $calling_obj) {
$myGET=t3lib_div::_GET();
if (($table=='tt_content' ||
$table=='pages')&&is_array($incomingFieldArray) &&
isset($myGET['publish']))
$incomingFieldArray['hidden']= $myGET['publish'];
}
doesn't do anything - pre or post processin is however the *only
reasonable* possibility to handle this issue - or that should be postprocess
thied also
processDatamap_postProcessFieldArray
No effect.
I just don't figure why neither pre of post processing doesn't do anything.
More information about the TYPO3-dev
mailing list