[TYPO3] Pre or postprocessing datamap
Tapio Markula
tapio.markula at atwebteam.com
Fri Oct 27 21:43:35 CEST 2006
Hi
I need to my plugin button, which changes in alt_doc.php
field hide (Publish/Unpublish)
I succeed to create the button itself and it saves changes
and send a parameters, which could be used for some special tasks.
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(); // extra button should send this
if (($table=='tt_content' ||
$table=='pages')&&is_array($incomingFieldArray) && isset($myGET['publish']))
$incomingFieldArray['hidden']= $myGET['publish'];
}
doesn't do anything
I tried 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-english
mailing list