Moderators Kyle Posted October 16, 2011 Moderators Report 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
Administrators simpilot Posted October 17, 2011 Administrators Report 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
Moderators Kyle Posted October 20, 2011 Author Moderators Report 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
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.