log("Loading Plugin: $plugin_name",LOGLEVEL_DEBUG); $app->plugins[$plugin_name] = new $module_name; $app->plugins[$plugin_name]->onLoad(); } } } } else { $app->log("Plugin directory missing: $plugins_dir",LOGLEVEL_ERROR); } } /* This function is called by the modules to register for a specific table change notification */ function registerEvent($event_name,$plugin_name,$function_name) { $this->notification_events[$event_name][] = array('plugin' => $plugin_name, 'function' => $function_name); } function raiseEvent($event_name,$data) { global $app; // Get the hooks for this table $events = $this->notification_hevents[$event_name]; if(is_array($events)) { foreach($events as $event) { $plugin_name = $event["plugin"]; $function_name = $event["function"]; // Claa the processing function of the module call_user_method($function_name,$app->plugins[$plugin_name],$event_name,$data); unset($plugin_name); unset($function_name); } } unset($event); unset($events); } } ?>