[TYPO3-commerce] $this->pi_getLL()

Bas van der Togt bas.vander.togt at efocus.nl
Thu Mar 20 15:59:14 CET 2008


found it allready by myself:

class tx_efprepaymentmail extends tslib_pibase {
	
	function ProcessMarker($markerArray,$parent) {
		$this->initLL($parent);
		
		$basket = $GLOBALS['TSFE']->fe_user->tx_commerce_basket;
		$paymentuid = 
$basket->get_articles_by_article_type_uid_asUidlist(PAYMENTArticleType);
		
		//markers legen als er gekozen is voor betaling per ogone
		if($paymentuid[0]==2468) {
			$markerArray['###ATTENTION###'] = '';
			$markerArray['###BANKACCOUNT###'] = '';
			$markerArray['###TO###'] = '';
			$markerArray['###CITY###'] = '';
			$markerArray['###ABROAD###'] = '';
			$markerArray['###IBAN###'] = '';
			$markerArray['###BIC###'] = '';
		}
		
		//marker vullen als er gekozen is voor betaling per overmaken
		if($paymentuid[0]==2) {
			$markerArray['###ATTENTION###'] = $this->pi_getLL('attention');
			$markerArray['###BANKACCOUNT###'] = $this->pi_getLL('bankaccount');
			$markerArray['###TO###'] = $this->pi_getLL('to');
			$markerArray['###CITY###'] = $this->pi_getLL('city');
			$markerArray['###ABROAD###'] = $this->pi_getLL('abroad');
			$markerArray['###IBAN###'] = $this->pi_getLL('iban');
			$markerArray['###BIC###'] = $this->pi_getLL('bic');
		}
						
		return $markerArray;
	}
	
	function initLL(&$parent) {
		$basePath = t3lib_extMgm::extPath('ef_prepayment').'lib/locallang.xml';
		$this->LOCAL_LANG = t3lib_div::readLLfile($basePath, $parent->LLkey);
		if ($parent->altLLkey)    {
			$tempLOCAL_LANG = t3lib_div::readLLfile($basePath,$parent->altLLkey);
			$this->LOCAL_LANG = array_merge(is_array($this->LOCAL_LANG) ? 
$this->LOCAL_LANG : array(),$tempLOCAL_LANG);
		}
	}
}	


Bas van der Togt wrote:
> hello,
> 
> I build a hook to add some markers to the usermail.
> The markers are replaced but now i want to use the $this->pi_getLL() 
> function. But this is not working with the the code below because i 
> don't get the $parent with the ProcessMarker(). Does anybody know how to 
> solve this problem?
> 
> kind regards,
> Bas
> 
> class tx_efprepaymentmail extends tslib_pibase {
>     
>     function ProcessMarker($markerArray,$this) {
>         $this->initLL($parent);
>        
>         $markerArray['###ATTENTION###'] = $this->pi_getLL('attention');
>         $markerArray['###BANKACCOUNT###'] = $this->pi_getLL('bankaccount');
>         $markerArray['###TO###'] = $this->pi_getLL('to');
>         $markerArray['###CITY###'] = $this->pi_getLL('city');
>         $markerArray['###ABROAD###'] = $this->pi_getLL('abroad');
>         $markerArray['###IBAN###'] = $this->pi_getLL('iban');
>         $markerArray['###BIC###'] = $this->pi_getLL('bic');
>                        
>         return $markerArray;
>     }
>     
>     function initLL(&$parent) {
>         $basePath = 
> t3lib_extMgm::extPath('ef_prepayment').'lib/locallang.xml';
>         $this->LOCAL_LANG = t3lib_div::readLLfile($basePath, 
> $parent->LLkey);
>         if ($parent->altLLkey)    {
>             $tempLOCAL_LANG = 
> t3lib_div::readLLfile($basePath,$parent->altLLkey);
>             $this->LOCAL_LANG = array_merge(is_array($this->LOCAL_LANG) 
> ? $this->LOCAL_LANG : array(),$tempLOCAL_LANG);
>         }
>     }
> }   


More information about the TYPO3-project-commerce mailing list