mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
This commit is contained in:
@@ -135,12 +135,12 @@ adminController.categories.get = function(req, res, next) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
|
||||
plugins.fireHook('filter:admin.category.get', {req: req, res: res, category: data.category[0], privileges: data.privileges}, function(err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
|
||||
res.render('admin/manage/category', {
|
||||
category: data.category,
|
||||
privileges: data.privileges
|
||||
@@ -153,24 +153,27 @@ adminController.categories.getAll = function(req, res, next) {
|
||||
var active = [],
|
||||
disabled = [];
|
||||
|
||||
categories.getAllCategories(req.uid, function (err, categoryData) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
db.getSortedSetRange('categories:cid', 0, -1, next);
|
||||
},
|
||||
function(cids, next) {
|
||||
categories.getCategoriesData(cids, next);
|
||||
},
|
||||
function(categories, next) {
|
||||
plugins.fireHook('filter:admin.categories.get', {req: req, res: res, categories: categories}, next);
|
||||
}
|
||||
], function(err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
plugins.fireHook('filter:admin.categories.get', {req: req, res: res, categories: categoryData}, function(err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
data.categories.filter(Boolean).forEach(function(category) {
|
||||
(category.disabled ? disabled : active).push(category);
|
||||
});
|
||||
|
||||
res.render('admin/manage/categories', {
|
||||
active: active,
|
||||
disabled: disabled
|
||||
});
|
||||
data.categories.filter(Boolean).forEach(function(category) {
|
||||
(category.disabled ? disabled : active).push(category);
|
||||
});
|
||||
|
||||
res.render('admin/manage/categories', {
|
||||
active: active,
|
||||
disabled: disabled
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user