mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Making sure the layer edit and delete actions return to the correct location.
work item: 17616 --HG-- branch : 1.x
This commit is contained in:
@@ -259,13 +259,13 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
this.Error(exception, T("Editing layer failed: {0}", exception.Message), Logger, Services.Notifier);
|
this.Error(exception, T("Editing layer failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||||
|
|
||||||
return RedirectToAction("Index", "Admin", new { id });
|
return RedirectToAction("Index", "Admin");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost, ActionName("EditLayer")]
|
[HttpPost, ActionName("EditLayer")]
|
||||||
[FormValueRequired("submit.Save")]
|
[FormValueRequired("submit.Save")]
|
||||||
public ActionResult EditLayerSavePOST(int id) {
|
public ActionResult EditLayerSavePOST(int id, string returnUrl) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageWidgets, T(NotAuthorizedManageWidgetsLabel)))
|
if (!Services.Authorizer.Authorize(Permissions.ManageWidgets, T(NotAuthorizedManageWidgetsLabel)))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
@@ -287,12 +287,12 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
this.Error(exception, T("Editing layer failed: {0}", exception.Message), Logger, Services.Notifier);
|
this.Error(exception, T("Editing layer failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost, ActionName("EditLayer")]
|
[HttpPost, ActionName("EditLayer")]
|
||||||
[FormValueRequired("submit.Delete")]
|
[FormValueRequired("submit.Delete")]
|
||||||
public ActionResult EditLayerDeletePOST(int id, string returnUrl) {
|
public ActionResult EditLayerDeletePOST(int id) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageWidgets, T(NotAuthorizedManageWidgetsLabel)))
|
if (!Services.Authorizer.Authorize(Permissions.ManageWidgets, T(NotAuthorizedManageWidgetsLabel)))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
this.Error(exception, T("Removing Layer failed: {0}", exception.Message), Logger, Services.Notifier);
|
this.Error(exception, T("Removing Layer failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
|
return RedirectToAction("Index", "Admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult EditWidget(int id) {
|
public ActionResult EditWidget(int id) {
|
||||||
@@ -325,8 +325,8 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
catch (Exception exception) {
|
catch (Exception exception) {
|
||||||
this.Error(exception, T("Editing widget failed: {0}", exception.Message), Logger, Services.Notifier);
|
this.Error(exception, T("Editing widget failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||||
|
|
||||||
if (widgetPart != null)
|
if (widgetPart != null && widgetPart.LayerPart != null)
|
||||||
return RedirectToAction("Index", "Admin", new { id = widgetPart.LayerPart.Id });
|
return RedirectToAction("Index", "Admin", new { layerId = widgetPart.LayerPart.Id });
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user