Adding notification when deleting a menu items

This commit is contained in:
Benedek Farkas
2025-10-03 21:42:41 +02:00
parent 14d19b9ccc
commit d6b177c563

View File

@@ -137,9 +137,9 @@ namespace Orchard.Core.Navigation.Controllers {
[HttpPost]
public ActionResult Delete(int id) {
MenuPart menuPart = _menuService.Get(id);
int? menuId = null;
if (!_authorizer.Authorize(
Permissions.ManageMenus,
menuPart == null ? null : _menuService.GetMenu(menuPart.Menu.Id),
@@ -166,6 +166,11 @@ namespace Orchard.Core.Navigation.Controllers {
}
}
_notifier.Information(T.Plural(
"The menu item '{1}' has been deleted.",
"The menu item '{1}' and its children have been deleted.",
menuItems.Count() + 1,
menuPart.MenuText));
}
return RedirectToAction("Index", new { menuId });