Add admin hooks for get categories

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

@ -136,10 +136,16 @@ adminController.categories.get = function(req, res, next) {
return next(err);
}
res.render('admin/manage/category', {
category: data.category[0],
privileges: data.privileges
});
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,
privileges: data.privileges
});
});
});
};
@ -153,13 +159,19 @@ adminController.categories.getAll = function(req, res, next) {
return next(err);
}
categoryData.filter(Boolean).forEach(function(category) {
(category.disabled ? disabled : active).push(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);
});
res.render('admin/manage/categories', {
active: active,
disabled: disabled
res.render('admin/manage/categories', {
active: active,
disabled: disabled
});
});
});
};

Loading…
Cancel
Save