mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
allow plugins/widgets to define widgets; moved sample widgets out of core and into nodebb-widget-essentials
This commit is contained in:
@@ -412,18 +412,25 @@ var nconf = require('nconf'),
|
||||
});
|
||||
|
||||
app.get('/themes', function (req, res) {
|
||||
plugins.fireHook('filter:widgets.getAreas', [], function(err, areas) {
|
||||
async.each(areas, function(area, next) {
|
||||
async.parallel({
|
||||
areas: function(next) {
|
||||
plugins.fireHook('filter:widgets.getAreas', [], next);
|
||||
},
|
||||
widgets: function(next) {
|
||||
plugins.fireHook('filter:widgets.getWidgets', [], next);
|
||||
}
|
||||
}, function(err, data) {
|
||||
async.each(data.areas, function(area, next) {
|
||||
widgets.getArea(area.template, area.location, function(err, areaData) {
|
||||
area.data = areaData;
|
||||
next(err);
|
||||
});
|
||||
}, function(err) {
|
||||
res.json(200, {
|
||||
areas: areas,
|
||||
areas: data.areas,
|
||||
widgets: data.widgets
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user