Showing the image editor for the local files only

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-04-22 16:14:20 -07:00
parent d8665455e8
commit 74f22d1443
2 changed files with 9 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
<Placement>
<Match DisplayType="SummaryAdmin">
<Place Parts_Image_Editor="Header" />
<Place Parts_Image_Editor="Footer:6" />
</Match>
<!-- ImagePart -->

View File

@@ -1,9 +1,15 @@
@using Orchard.MediaLibrary.Models
@using Orchard.ContentManagement
@using Orchard.MediaLibrary.Models
@{
ImagePart imagePart = Model.ContentPart;
// do not show the editor if the image is not local
if (!imagePart.As<MediaPart>().Resource.StartsWith("~/")) {
return;
}
}
@Html.ActionLink(T("Edit").Text, "Index", "Admin", new { id = imagePart.Id, area = "Orchard.ImageEditor" }, new { id="edit-image-link"})
@Html.ActionLink(T("Image Editor").Text, "Index", "Admin", new { id = imagePart.Id, area = "Orchard.ImageEditor" }, new { id="edit-image-link", @class="button"})
<script type="text/javascript">
//<![CDATA[