• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [Solved] How to pass params between EventManager UDTs ?
PostPosted: Wed Jun 13, 2012 1:37 pm 
Offline
Forum Members
Forum Members

Joined: Sun Feb 03, 2008 8:14 pm
Posts: 17
I am using a 3rd party module (one of the forums), it has a number of events. In event manager I have assigned to each event two UDTs. The first is the code specific to that event. The second is the code that is generic to all events - so I want this second UDT to be executed by all events.

No problems so far - easy to set this up in EventManager. To illustrate:
  • Event: OnNewTopic
    • UDT1=newTopic
    • UDT2=forumEventHandler
  • Event: OnReply
    • UDT1=newReply
    • UDT2=forumEventHandler
I need to pass one small string parameter from the first UDT to the second. Though perhaps that in the first UDT I could set a Smart template variable like so:
Code:
global $gCms;
$smarty = &$gCms->GetSmarty();
$smarty->assign('forum_mode', 'OnNewTopic');


then in second UDT get it via:
Code:
global $gCms;
$smarty = &$gCms->GetSmarty();
$tpl_vars = $smarty->get_template_vars();
$tpl_vars['forum_mode']

But this doesn't work. Tried var_dumping $tpl_vars and $smarty. Not there. Any suggestions. Worst case I will have to duplicate the code that is in the second UDT in all of the first UDTs.

Thanks for your help



Setting $smarty->get_template_vars(); does work. it was my testing method that was incorrect. duh!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner