[TYPO3-calendar] flexible saveEventToPid?

Mario Matzulla mario at matzullas.de
Thu May 26 10:50:51 CEST 2011


Hi Martin,

Am 25.05.11 15:31, schrieb Martin Keller:
> which brings me to the next step - creating a hook-extension
> "mk_calsavepid" with two basic files.
> The concept behind the extension is to post-process a stored event to
> move it to a different pid. I hope I will find all neccesary data in
> $this. This is why I do the t3lib_div::debug().
>
> ext_localconf.php
> <?php
> // registering the hook
> $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ext/cal/controller/class.tx_cal_controller.php']['saveEventClass'][]
> =
> 'EXT:mk_calsavepid/class.cal_controller_saveeventhook.php:&tx_mkcalsavepid_saveEventClass';

$GLOBALS 
['TYPO3_CONF_VARS']['FE']['EXTCONF']['ext/cal/controller/class.tx_cal_controller.php']['saveEventClass'][] 
= 
'EXT:'.$_EXTKEY.'/class.cal_controller_saveeventhook.php:&tx_mkcalsavepid_saveEventClass';

['FE'] was missing ;)

And the provided object is the tx_cal_controller class

Regards,
Mario

>
> ?>
>
> class.cal_controller_saveeventhook.php
> <?php
> /*
> realizes a "saveEventClass" hook with function "postSaveEvent" for
> extension cal
> See more details in ext/cal/controller/class.tx_cal_controller.php -
> function saveEvent()
> */
> class tx_mkcalsavepid_saveEventClass {
>
> function postSaveEvent (&$this) {
> // here comes the code
> t3lib_div::debug($this,'function postSaveEvent &$this');
> die('class tx_mkcalsavepid_saveEventClass:done!');
> }
>
> }
> ?>
> a) do I have to require_once or otherwise include the class? (I did not
> see it being done in the samples)
> b) ext_localconf is included in temp_CACHED_FE_psb4eb_ext_localconf.php,
> so far it works
> c) in class.tx_cal_controller.php in function
> executeHookObjectsFunction($hookObjectsArray, $function)
> $hookObjectsArray is empty(???) This gives the hint that my
> ext_localconf is wrong.
> d) the die() statement never appears
>
> Why dont I see a die() statement, where is my bug?
> Sometimes I see a "&" in ext_localconf befor the classname. What does it
> mean?
>
> kind regards,
> Martin



More information about the TYPO3-project-calendar mailing list