public ActionResult IndexPOST(IList <MenuItemEntry> menuItemEntries) { if (!_services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu"))) { return(new HttpUnauthorizedResult()); } // See http://orchard.codeplex.com/workitem/17116 if (menuItemEntries != null) { foreach (var menuItemEntry in menuItemEntries) { MenuPart menuPart = _menuService.Get(menuItemEntry.MenuItemId); menuPart.MenuText = menuItemEntry.Text; menuPart.MenuPosition = menuItemEntry.Position; if (menuPart.Is <MenuItemPart>()) { menuPart.As <MenuItemPart>().Url = menuItemEntry.Url; } } } return(RedirectToAction("Index")); }
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { return(new MenuItemEntry { MenuItemId = menuPart.Id, IsMenuItem = menuPart.Is <MenuItemPart>(), Text = menuPart.MenuText, Position = menuPart.MenuPosition, Url = menuPart.Is <MenuItemPart>() ? menuPart.As <MenuItemPart>().Url : _navigationManager.GetUrl(null, _services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues), }); }
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { return new MenuItemEntry { MenuItemId = menuPart.Id, IsMenuItem = menuPart.Is<MenuItemPart>(), Text = menuPart.MenuText, Position = menuPart.MenuPosition, Url = menuPart.Is<MenuItemPart>() ? menuPart.As<MenuItemPart>().Url : _navigationManager.GetUrl(null, Services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues), ContentItem = menuPart.ContentItem, }; }