- Version 1.0.0 -
-- Content protector prevent users from performing certain action on a given media node. -
- -- Actions: -
-Version 2.0.0
+Content protector prevent users from performing certain action on a given node.
+ +Actions:
+Version 1.0.0
+Content protector prevent users from performing certain action on a given node.
+ +Actions:
+@ex.ToString()+} + +@functions{ + + public static string EditorView(dynamic contentItem) + { + string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString(); + view = view.Replace(".html", ".cshtml"); + + if (!view.Contains("/")) + { + view = "grid/editors/" + view; + } + + return view; + } +} diff --git a/src/ContentProtector.Web/Views/Partials/grid/editors/embed.cshtml b/src/ContentProtector.Web/Views/Partials/grid/editors/embed.cshtml new file mode 100644 index 0000000..74c8fe2 --- /dev/null +++ b/src/ContentProtector.Web/Views/Partials/grid/editors/embed.cshtml @@ -0,0 +1,11 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@Model.value.caption
+ } +} diff --git a/src/ContentProtector.Web/Views/Partials/grid/editors/rte.cshtml b/src/ContentProtector.Web/Views/Partials/grid/editors/rte.cshtml new file mode 100644 index 0000000..9445666 --- /dev/null +++ b/src/ContentProtector.Web/Views/Partials/grid/editors/rte.cshtml @@ -0,0 +1,13 @@ +@using Umbraco.Cms.Core.Templates +@model dynamic +@inject HtmlLocalLinkParser HtmlLocalLinkParser; +@inject HtmlUrlParser HtmlUrlParser; +@inject HtmlImageSourceParser HtmlImageSourceParser; + +@{ + var value = HtmlLocalLinkParser.EnsureInternalLinks(Model?.value.ToString()); + value = HtmlUrlParser.EnsureUrls(value); + value = HtmlImageSourceParser.EnsureImageSources(value); +} + +@Html.Raw(value) diff --git a/src/ContentProtector.Web/Views/Partials/grid/editors/textstring.cshtml b/src/ContentProtector.Web/Views/Partials/grid/editors/textstring.cshtml new file mode 100644 index 0000000..d4152a5 --- /dev/null +++ b/src/ContentProtector.Web/Views/Partials/grid/editors/textstring.cshtml @@ -0,0 +1,23 @@ +@using System.Web +@model dynamic + +@if (Model?.editor.config.markup is not null) +{ + string markup = Model.editor.config.markup.ToString(); + markup = markup.Replace("#value#", Html.ReplaceLineBreaks((string)Model.value.ToString()).ToString()); + + if (Model.editor.config.style != null) + { + markup = markup.Replace("#style#", Model.editor.config.style.ToString()); + } + +