|
|
|
@ -45,6 +45,8 @@ middleware.buildHeader = function(req, res, next) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
userData.uid = uid;
|
|
|
|
|
|
|
|
|
|
async.parallel({
|
|
|
|
|
scripts: function(next) {
|
|
|
|
|
plugins.fireHook('filter:admin.scripts.get', [], function(err, scripts) {
|
|
|
|
@ -61,16 +63,22 @@ middleware.buildHeader = function(req, res, next) {
|
|
|
|
|
},
|
|
|
|
|
custom_header: function(next) {
|
|
|
|
|
plugins.fireHook('filter:admin.header.build', custom_header, next);
|
|
|
|
|
},
|
|
|
|
|
config: function(next) {
|
|
|
|
|
controllers.api.getConfig(req, res, next);
|
|
|
|
|
}
|
|
|
|
|
}, function(err, pluginData) {
|
|
|
|
|
}, function(err, results) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
res.locals.config = results.config;
|
|
|
|
|
var data = {
|
|
|
|
|
relative_path: nconf.get('relative_path'),
|
|
|
|
|
plugins: pluginData.custom_header.plugins,
|
|
|
|
|
authentication: pluginData.custom_header.authentication,
|
|
|
|
|
scripts: pluginData.scripts,
|
|
|
|
|
configJSON: JSON.stringify(results.config),
|
|
|
|
|
userJSON: JSON.stringify(userData),
|
|
|
|
|
plugins: results.custom_header.plugins,
|
|
|
|
|
authentication: results.custom_header.authentication,
|
|
|
|
|
scripts: results.scripts,
|
|
|
|
|
userpicture: userData.picture,
|
|
|
|
|
username: userData.username,
|
|
|
|
|
userslug: userData.userslug,
|
|
|
|
@ -88,12 +96,6 @@ middleware.buildHeader = function(req, res, next) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
function(next) {
|
|
|
|
|
controllers.api.getConfig(req, res, function(err, config) {
|
|
|
|
|
res.locals.config = config;
|
|
|
|
|
next(err);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
function(next) {
|
|
|
|
|
app.render('admin/footer', {}, function(err, template) {
|
|
|
|
|
res.locals.adminFooter = template;
|
|
|
|
|