Add admin hooks for get categories

v1.18.x
Сергей Савельев 10 years ago
parent f7a3428bf8
commit 621ae9c91a

@ -136,11 +136,17 @@ adminController.categories.get = function(req, res, next) {
return next(err);
}
plugins.fireHook('filter:admin.categories.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[0],
category: data.category,
privileges: data.privileges
});
});
});
};
adminController.categories.getAll = function(req, res, next) {
@ -153,7 +159,12 @@ adminController.categories.getAll = function(req, res, next) {
return next(err);
}
categoryData.filter(Boolean).forEach(function(category) {
plugins.fireHook('filter:admin.categories.getAll', {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);
});
@ -162,6 +173,7 @@ adminController.categories.getAll = function(req, res, next) {
disabled: disabled
});
});
});
};
adminController.tags.get = function(req, res, next) {

Loading…
Cancel
Save