fixed action calls, and added a new hook for plugin activation and deactivation

v1.18.x
Julian Lam 11 years ago
parent fa2fe5c941
commit 918826ff48

@ -187,7 +187,7 @@ var fs = require('fs'),
break;
case 'action':
async.each(hookList, function(hookObj) {
if (hookObj.method) hookObj.method.apply(_self.libraries[hookObj.id], args);
if (hookObj.method) hookObj.method.call(_self.libraries[hookObj.id], args);
else {
if (global.env === 'development') winston.info('[plugins] Expected method \'' + hookObj.method + '\' in plugin \'' + hookObj.id + '\' not found, skipping.');
}
@ -219,6 +219,9 @@ var fs = require('fs'),
return;
}
// (De)activation Hooks
plugins.fireHook('action:plugin.' + (active ? 'de' : '') + 'activate', id);
if (callback) {
callback({
id: id,

Loading…
Cancel
Save