[TYPO3-UG Dutch] Hook in Pbsurvey

Henjo Hoeksma hphoeksma at stylence.nl
Thu Aug 7 21:39:17 CEST 2008


Hi Patrick,

bedankt voor je reactie. Ik kon het vanmiddag niet testen, vandaar pas nu...

Het deed inderdaad de trick. Bedankt!

On 2008-08-07 09:08:09 +0200, Patrick Broens <patrick at netcreators.com> said:

> Hoi Henjo,
> 
> Het volgende plaats je in ext_localconf.php:
> 
> if (TYPO3_MODE != 'BE')    {
> 	require_once( t3lib_extMgm::extPath('nc_cnvtestpiw') . 
> 'class.kopbsurveyext.php');
> }
> // Add Hooks 	
> $TYPO3_CONF_VARS['EXTCONF']['pbsurvey']['tx_pbsurvey_pi1']['processHookItem'][] 
> = 'tx_kopbsurveyext';
> 
> TYPO3 weet namelijk al waar dat hij deze class kan vinden. Dat was het 
> probleem.
> 
> Patrick
> 
> Henjo Hoeksma wrote:
>> Hi list,
>> 
>> hooks is niet mijn favo dingetje - op de e.e.a. heb ik daar nogal 
>> moeite mee om helder te krijgen hoe het werkt (en ja - ik lees de 
>> docu's ) ;-)
>> 
>> Ik wil een hook gebruiken bij pbsurvey en heb de volgende code 
>> gebruikt, met alleen foutmeldingen als "Call to a member function 
>> hookItemProcessor() on a non-object"
>> 
>> Code:
>> The hook (from pbsurvey)
>> ###
>> function callHook($arrItem) {
>>        if 
>> (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['processHookItem'])) 
>> {
>>             
>> foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->prefixId]['processHookItem'] 
>> as $_classRef) {
>>                 $_procObj = & t3lib_div::getUserObj($_classRef);
>>                 $strOutput = $_procObj->hookItemProcessor($arrItem, $this);
>>             }
>>             return $strOutput;
>>        }
>>    }
>> ###
>> 
>> My class (license stripped) class.kopbsurveyext.php
>> ###
>> <?php
>> 
>> class tx_kopbsurveyext {
>>         function hookItemProcessor($arrItem,&$pObj) {
>>         $content = "test";
>>         return $content;
>>     }
>> 
>> }
>> 
>> ?>
>> ###
>> 
>> My ext_localconf.php
>> ###
>> <?php
>> 
>> if (!defined ("TYPO3_MODE"))     die ("Access denied.");
>> 
>> if(TYPO3_MODE != 'BE') {
>>  
>> require_once(t3lib_extMgm::extPath('kopbsurveyext').'class.kopbsurveyext.php');
}


$TYPO3_CONF_VARS['EXTCONF']['pbsurvey']['tx_pbsurvey_pi1']['processHookItem'][]
=
'EXT:kopbsurveyext/class.kopbsurveyext.php:tx_kopbsurveyext';

?>
###

Tips 
>> 
>> zijn  gewenst - bij voorbaat dank!


-- 
Met vriendelijke groet, kinds regards,

Henjo Hoeksma
Stylence | 2b launched soon!
www.stylence.nl



More information about the TYPO3-UG-dutch mailing list