mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
fix acp for header changes
This commit is contained in:
@@ -45,6 +45,8 @@ middleware.buildHeader = function(req, res, next) {
|
|||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userData.uid = uid;
|
||||||
|
|
||||||
async.parallel({
|
async.parallel({
|
||||||
scripts: function(next) {
|
scripts: function(next) {
|
||||||
plugins.fireHook('filter:admin.scripts.get', [], function(err, scripts) {
|
plugins.fireHook('filter:admin.scripts.get', [], function(err, scripts) {
|
||||||
@@ -61,16 +63,22 @@ middleware.buildHeader = function(req, res, next) {
|
|||||||
},
|
},
|
||||||
custom_header: function(next) {
|
custom_header: function(next) {
|
||||||
plugins.fireHook('filter:admin.header.build', custom_header, 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) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
res.locals.config = results.config;
|
||||||
var data = {
|
var data = {
|
||||||
relative_path: nconf.get('relative_path'),
|
relative_path: nconf.get('relative_path'),
|
||||||
plugins: pluginData.custom_header.plugins,
|
configJSON: JSON.stringify(results.config),
|
||||||
authentication: pluginData.custom_header.authentication,
|
userJSON: JSON.stringify(userData),
|
||||||
scripts: pluginData.scripts,
|
plugins: results.custom_header.plugins,
|
||||||
|
authentication: results.custom_header.authentication,
|
||||||
|
scripts: results.scripts,
|
||||||
userpicture: userData.picture,
|
userpicture: userData.picture,
|
||||||
username: userData.username,
|
username: userData.username,
|
||||||
userslug: userData.userslug,
|
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) {
|
function(next) {
|
||||||
app.render('admin/footer', {}, function(err, template) {
|
app.render('admin/footer', {}, function(err, template) {
|
||||||
res.locals.adminFooter = template;
|
res.locals.adminFooter = template;
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var RELATIVE_PATH = "{relative_path}";
|
var RELATIVE_PATH = "{relative_path}";
|
||||||
|
var config = JSON.parse('{configJSON}');
|
||||||
|
var app = {};
|
||||||
|
app.user = JSON.parse('{userJSON}');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
|
|||||||
Reference in New Issue
Block a user