mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Made the path for where tinymce saves media dynamic
--HG-- branch : dev
This commit is contained in:
@@ -2,6 +2,6 @@
|
|||||||
<%@ Import Namespace="Orchard.Core.Common.ViewModels" %>
|
<%@ Import Namespace="Orchard.Core.Common.ViewModels" %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label><%=_Encoded("Body")%></label>
|
<label><%=_Encoded("Body")%></label>
|
||||||
<%=Html.EditorFor(m => m.Text, Model.TextEditorTemplate) %>
|
<%=Html.Partial("EditorTemplates/" + Model.TextEditorTemplate, Model) %>
|
||||||
<%=Html.ValidationMessageFor(m => m.Text) %>
|
<%=Html.ValidationMessageFor(m => m.Text) %>
|
||||||
</fieldset>
|
</fieldset>
|
@@ -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.UI;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.ContentManagement.Drivers;
|
using Orchard.ContentManagement.Drivers;
|
||||||
using Orchard.Core.Common.Models;
|
using Orchard.Core.Common.Models;
|
||||||
@@ -16,7 +17,8 @@ namespace TinyMce.Extensions {
|
|||||||
var currentModule = htmlHelper.Resolve<IExtensionManager>().ActiveExtensions().FirstOrDefault(ee => ee.Descriptor.ExtensionType == "Module" && ee.Assembly == currentDriver.GetType().Assembly);
|
var currentModule = htmlHelper.Resolve<IExtensionManager>().ActiveExtensions().FirstOrDefault(ee => ee.Descriptor.ExtensionType == "Module" && ee.Assembly == currentDriver.GetType().Assembly);
|
||||||
var routable = body.ContentItem.Has<RoutableAspect>() ? body.ContentItem.As<RoutableAspect>() : null;
|
var routable = body.ContentItem.Has<RoutableAspect>() ? body.ContentItem.As<RoutableAspect>() : null;
|
||||||
|
|
||||||
return string.Format("{0}/{1}{2}", "~/Media", currentModule.Descriptor.Name, routable != null && !string.IsNullOrEmpty(routable.ContainerPath) ? "/" + routable.ContainerPath : "");
|
//TODO: (erikpo) Get the value for the media folder from settings instead of hardcoding it
|
||||||
|
return ((Control)htmlHelper.ViewDataContainer).ResolveUrl(string.Format("{0}/{1}{2}", "~/Media", currentModule.Descriptor.Name, routable != null && !string.IsNullOrEmpty(routable.ContainerPath) ? "/" + routable.ContainerPath : ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,8 +1,8 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<string>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BodyEditorViewModel>" %>
|
||||||
<%@ Import Namespace="TinyMce.Extensions"%>
|
<%@ Import Namespace="TinyMce.Extensions"%>
|
||||||
<%@ Import Namespace="Orchard.Core.Common.ViewModels"%>
|
<%@ Import Namespace="Orchard.Core.Common.ViewModels"%>
|
||||||
<% Html.RegisterScript("tiny_mce.js"); %>
|
<% Html.RegisterScript("tiny_mce.js"); %>
|
||||||
<%=Html.TextArea("", Model, 25, 80, new { @class = "html" }) %>
|
<%=Html.TextArea("Text", Model.Text, 25, 80, new { @class = "html" }) %>
|
||||||
|
|
||||||
<%
|
<%
|
||||||
using (this.Capture("end-of-page-scripts")) {%>
|
using (this.Capture("end-of-page-scripts")) {%>
|
||||||
@@ -18,7 +18,7 @@ using (this.Capture("end-of-page-scripts")) {%>
|
|||||||
theme_advanced_buttons2: "",
|
theme_advanced_buttons2: "",
|
||||||
theme_advanced_buttons3: "",
|
theme_advanced_buttons3: "",
|
||||||
addmedia_action: "<%=Url.Action("AddFromClient", "Admin", new {area = "Orchard.Media"}) %>",
|
addmedia_action: "<%=Url.Action("AddFromClient", "Admin", new {area = "Orchard.Media"}) %>",
|
||||||
addmedia_path: "somepath",
|
addmedia_path: "<%=Html.GetCurrentMediaPath() %>",
|
||||||
request_verification_token: "<%=Html.AntiForgeryTokenValueOrchard() %>"
|
request_verification_token: "<%=Html.AntiForgeryTokenValueOrchard() %>"
|
||||||
});
|
});
|
||||||
</script><%
|
</script><%
|
||||||
|
Reference in New Issue
Block a user