mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18845: Persisting menu navigation during postbacks
Work Item: 18845 --HG-- branch : 1.5.x
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
using System.Web.Routing;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.Core.Common.Models;
|
using Orchard.Core.Common.Models;
|
||||||
using Orchard.Core.Navigation.Models;
|
using Orchard.Core.Navigation.Models;
|
||||||
@@ -78,7 +79,7 @@ namespace Orchard.Core.Navigation.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost, ActionName("Index")]
|
[HttpPost, ActionName("Index")]
|
||||||
public ActionResult IndexPOST(IList<MenuItemEntry> menuItemEntries) {
|
public ActionResult IndexPOST(IList<MenuItemEntry> menuItemEntries, int? menuId) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
|
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@ namespace Orchard.Core.Navigation.Controllers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index", new { menuId });
|
||||||
}
|
}
|
||||||
|
|
||||||
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) {
|
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) {
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<button type="submit" class="apply-bulk-actions-auto">@T("Show")</button>
|
<button type="submit" class="apply-bulk-actions-auto">@T("Show")</button>
|
||||||
@Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation" }) }, new { @class = "button" })
|
@Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation", menuId = Model.CurrentMenu.Id }) }, new { @class = "button" })
|
||||||
</fieldset>
|
</fieldset>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
|
|
||||||
@using (Html.BeginFormAntiForgeryPost()) {
|
@using (Html.BeginFormAntiForgeryPost()) {
|
||||||
|
@Html.Hidden("menuId", Model.CurrentMenu.Id)
|
||||||
<div class="sections">
|
<div class="sections">
|
||||||
<div class="primary">
|
<div class="primary">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
Reference in New Issue
Block a user