Moderators Kyle Posted October 16, 2011 Moderators Report Share Posted October 16, 2011 Hey, If I add a CodonEvent:Dispatch into the ApprovePilot area, will it affect anything to cause errors? Here's how I have it done... CodonEvent::Dispatch('pilot_approved', 'PilotAdmin', $_POST); If I added this, and then add a module listener. Would the CodoEvent:Dispatch work in the 'pilot_approved' area? Any help would be great! Thanks! Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 17, 2011 Administrators Report Share Posted October 17, 2011 There is already an event on the admin side when a pilot is approved in PilotAdmin.php on line 632; CodonEvent::Dispatch('pilot_approved', 'PilotAdmin', $pilot); ' You just need to build the hook (listener) in your new module that is looking for the event, something like this in your module; public function __construct() { CodonEvent::addListener('MyNewModuleName', array('pilot_approved')); } public function EventListener($eventinfo) { if($eventinfo[0] == 'pilot_approved') { //do stuff } } Just remember that a module on the pilot side of the system will not catch an event from the admin side, and vice-versa. 1 Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted October 20, 2011 Author Moderators Report Share Posted October 20, 2011 Thanks for the help simpilot. Perhaps I'll have to find a way around to hook to get the pilot approved. 1+ rep! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.