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

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

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

Loading…
Cancel
Save