Merge pull request #3360 from jsdream/renderHeaderHook

Add 'filter:middleware.renderHeader' hook
v1.18.x
Barış Soner Uşaklı 10 years ago
commit 5e9a123e70

@ -302,7 +302,13 @@ middleware.renderHeader = function(req, res, callback) {
templateValues.template = {name: res.locals.template};
templateValues.template[res.locals.template] = true;
app.render('header', templateValues, callback);
plugins.fireHook('filter:middleware.renderHeader', {templateValues: templateValues, req: req, res: res}, function(err, data) {
if (err) {
return callback(err);
}
app.render('header', data.templateValues, callback);
});
});
};
@ -520,4 +526,4 @@ module.exports = function(webserver) {
middleware.admin = require('./admin')(webserver);
return middleware;
};
};

Loading…
Cancel
Save