mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
Fixing media item return url in edit mode
--HG-- branch : 1.x
This commit is contained in:
@@ -3,9 +3,19 @@
|
|||||||
@using Orchard.Utility.Extensions
|
@using Orchard.Utility.Extensions
|
||||||
@{
|
@{
|
||||||
ContentItem contentItem = Model.ContentItem;
|
ContentItem contentItem = Model.ContentItem;
|
||||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
|
||||||
}
|
}
|
||||||
@if (Authorizer.Authorize(Permissions.EditContent, contentItem)) {
|
|
||||||
@Html.Link(T("Edit").Text, Url.ItemEditUrl(contentItem, new {returnUrl}), new {@class = "button"})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@if (Authorizer.Authorize(Permissions.EditContent, contentItem)) {
|
||||||
|
@Html.Link(T("Edit").Text, Url.ItemEditUrl(contentItem), new {@class = "button", id="edit-media-link"})
|
||||||
|
}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
//<![CDATA[
|
||||||
|
// update the returnUrl from javascript to get the main window's location
|
||||||
|
$('#edit-media-link').each(function() {
|
||||||
|
var self = $(this);
|
||||||
|
var returnUrl = self.attr('href') + '?returnUrl=' + encodeURIComponent(window.location);
|
||||||
|
self.attr('href', returnUrl);
|
||||||
|
});
|
||||||
|
//]]>
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user