2011-05-21 14:34:46 -12:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
2012-09-14 09:09:23 +07:00
|
|
|
|
using Umbraco.Core.Dynamics;
|
|
|
|
|
|
using Umbraco.Web;
|
2011-05-21 14:47:57 -12:00
|
|
|
|
using umbraco.interfaces;
|
2011-06-12 11:50:35 -02:00
|
|
|
|
using System.Xml.Linq;
|
2011-06-12 13:34:15 -02:00
|
|
|
|
using System.Xml.XPath;
|
2011-06-26 09:51:46 -12:00
|
|
|
|
using System.Web;
|
|
|
|
|
|
using System.IO;
|
2011-10-04 08:34:34 -13:00
|
|
|
|
using HtmlAgilityPack;
|
2011-05-21 14:34:46 -12:00
|
|
|
|
|
|
|
|
|
|
namespace umbraco.MacroEngines.Library
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
public class RazorLibraryCore
|
2011-05-21 14:34:46 -12:00
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
private readonly INode _node;
|
|
|
|
|
|
private readonly UmbracoHelper _umbracoHelper;
|
2011-05-21 14:47:57 -12:00
|
|
|
|
public INode Node
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _node; }
|
|
|
|
|
|
}
|
|
|
|
|
|
public RazorLibraryCore(INode node)
|
|
|
|
|
|
{
|
|
|
|
|
|
this._node = node;
|
2012-09-14 09:09:23 +07:00
|
|
|
|
_umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
2011-05-21 14:47:57 -12:00
|
|
|
|
}
|
|
|
|
|
|
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic NodeById(int Id)
|
2011-05-21 14:47:57 -12:00
|
|
|
|
{
|
2011-10-09 06:43:37 -13:00
|
|
|
|
var node = new DynamicNode(Id);
|
|
|
|
|
|
if (node != null && node.Id == 0) return new DynamicNull();
|
|
|
|
|
|
return node;
|
2011-06-12 08:23:10 -02:00
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic NodeById(string Id)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
2011-10-09 06:43:37 -13:00
|
|
|
|
var node = new DynamicNode(Id);
|
|
|
|
|
|
if (node != null && node.Id == 0) return new DynamicNull();
|
|
|
|
|
|
return node;
|
2011-06-12 08:23:10 -02:00
|
|
|
|
}
|
2011-10-09 07:06:52 -13:00
|
|
|
|
public dynamic NodeById(DynamicNull Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new DynamicNull();
|
|
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic NodeById(object Id)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
2011-07-03 18:31:47 -12:00
|
|
|
|
if (Id.GetType() == typeof(DynamicNull))
|
|
|
|
|
|
{
|
2011-10-09 06:43:37 -13:00
|
|
|
|
return new DynamicNull();
|
2011-07-03 18:31:47 -12:00
|
|
|
|
}
|
2011-10-09 06:43:37 -13:00
|
|
|
|
var node = new DynamicNode(Id);
|
|
|
|
|
|
if (node != null && node.Id == 0) return new DynamicNull();
|
|
|
|
|
|
return node;
|
2011-06-12 08:23:10 -02:00
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic NodesById(List<object> Ids)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
|
|
|
|
|
List<DynamicNode> nodes = new List<DynamicNode>();
|
|
|
|
|
|
foreach (object eachId in Ids)
|
|
|
|
|
|
nodes.Add(new DynamicNode(eachId));
|
|
|
|
|
|
return new DynamicNodeList(nodes);
|
|
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic NodesById(List<int> Ids)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
|
|
|
|
|
List<DynamicNode> nodes = new List<DynamicNode>();
|
|
|
|
|
|
foreach (int eachId in Ids)
|
|
|
|
|
|
nodes.Add(new DynamicNode(eachId));
|
|
|
|
|
|
return new DynamicNodeList(nodes);
|
|
|
|
|
|
}
|
2011-08-15 10:18:15 -12:00
|
|
|
|
public dynamic NodesById(List<int> Ids, DynamicBackingItemType ItemType)
|
|
|
|
|
|
{
|
|
|
|
|
|
List<DynamicNode> nodes = new List<DynamicNode>();
|
|
|
|
|
|
foreach (int eachId in Ids)
|
|
|
|
|
|
nodes.Add(new DynamicNode(eachId, ItemType));
|
|
|
|
|
|
return new DynamicNodeList(nodes);
|
|
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic NodesById(params object[] Ids)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
2011-06-13 15:21:16 -02:00
|
|
|
|
return NodesById(Ids.ToList());
|
2011-06-12 08:23:10 -02:00
|
|
|
|
}
|
2011-10-09 07:06:52 -13:00
|
|
|
|
public dynamic MediaById(DynamicNull Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new DynamicNull();
|
|
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic MediaById(int Id)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
2011-10-09 06:43:37 -13:00
|
|
|
|
var ebm = ExamineBackedMedia.GetUmbracoMedia(Id);
|
|
|
|
|
|
if (ebm != null && ebm.Id == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new DynamicNull();
|
|
|
|
|
|
}
|
|
|
|
|
|
return new DynamicMedia(new DynamicBackingItem(ebm));
|
2011-06-12 08:23:10 -02:00
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic MediaById(string Id)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
|
|
|
|
|
int mediaId = 0;
|
|
|
|
|
|
if (int.TryParse(Id, out mediaId))
|
|
|
|
|
|
{
|
|
|
|
|
|
return MediaById(mediaId);
|
|
|
|
|
|
}
|
2011-10-09 06:43:37 -13:00
|
|
|
|
return new DynamicNull();
|
2011-06-12 08:23:10 -02:00
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic MediaById(object Id)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
2011-07-03 18:31:47 -12:00
|
|
|
|
if (Id.GetType() == typeof(DynamicNull))
|
|
|
|
|
|
{
|
2011-10-09 06:43:37 -13:00
|
|
|
|
return new DynamicNull();
|
2011-07-03 18:31:47 -12:00
|
|
|
|
}
|
2011-06-12 08:23:10 -02:00
|
|
|
|
int mediaId = 0;
|
|
|
|
|
|
if (int.TryParse(string.Format("{0}", Id), out mediaId))
|
|
|
|
|
|
{
|
|
|
|
|
|
return MediaById(mediaId);
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic MediaById(List<object> Ids)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
|
|
|
|
|
List<DynamicNode> nodes = new List<DynamicNode>();
|
|
|
|
|
|
foreach (object eachId in Ids)
|
|
|
|
|
|
nodes.Add(MediaById(eachId));
|
|
|
|
|
|
return new DynamicNodeList(nodes);
|
|
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic MediaById(List<int> Ids)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
|
|
|
|
|
List<DynamicNode> nodes = new List<DynamicNode>();
|
|
|
|
|
|
foreach (int eachId in Ids)
|
|
|
|
|
|
nodes.Add(MediaById(eachId));
|
|
|
|
|
|
return new DynamicNodeList(nodes);
|
|
|
|
|
|
}
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic MediaById(params object[] Ids)
|
2011-06-12 08:23:10 -02:00
|
|
|
|
{
|
|
|
|
|
|
return MediaById(Ids.ToList());
|
2011-05-21 14:47:57 -12:00
|
|
|
|
}
|
|
|
|
|
|
|
2012-07-04 10:54:49 -02:00
|
|
|
|
|
|
|
|
|
|
public dynamic Search(string term, bool useWildCards = true, string searchProvider = null)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
//wraps the functionality in UmbracoHelper but still returns the legacy DynamicNodeList
|
|
|
|
|
|
var nodes = ((DynamicDocumentList)_umbracoHelper.Search(term, useWildCards, searchProvider))
|
|
|
|
|
|
.Select(x => x.ConvertToNode());
|
|
|
|
|
|
return new DynamicNodeList(nodes);
|
2012-07-04 10:54:49 -02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public dynamic Search(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
//wraps the functionality in UmbracoHelper but still returns the legacy DynamicNodeList
|
|
|
|
|
|
var nodes = ((DynamicDocumentList) _umbracoHelper.Search(criteria, searchProvider))
|
|
|
|
|
|
.Select(x => x.ConvertToNode());
|
|
|
|
|
|
return new DynamicNodeList(nodes);
|
2012-07-04 10:54:49 -02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-12 11:50:35 -02:00
|
|
|
|
public T As<T>() where T : class
|
|
|
|
|
|
{
|
|
|
|
|
|
return (this as T);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic ToDynamicXml(string xml)
|
2011-06-12 11:50:35 -02:00
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.ToDynamicXml(xml);
|
2011-06-12 11:50:35 -02:00
|
|
|
|
}
|
2012-09-14 09:09:23 +07:00
|
|
|
|
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic ToDynamicXml(XElement xElement)
|
2012-09-14 09:09:23 +07:00
|
|
|
|
{
|
|
|
|
|
|
return _umbracoHelper.ToDynamicXml(xElement);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-06-27 12:45:17 -12:00
|
|
|
|
public dynamic ToDynamicXml(XPathNodeIterator xpni)
|
2012-09-14 09:09:23 +07:00
|
|
|
|
{
|
|
|
|
|
|
return _umbracoHelper.ToDynamicXml(xpni);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-06-12 12:00:05 -02:00
|
|
|
|
public string Coalesce(params object[] args)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.Coalesce<DynamicNull>(args);
|
2011-06-12 12:00:05 -02:00
|
|
|
|
}
|
2011-06-12 12:09:59 -02:00
|
|
|
|
|
|
|
|
|
|
public string Concatenate(params object[] args)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.Concatenate<DynamicNull>(args);
|
2011-06-12 12:09:59 -02:00
|
|
|
|
}
|
|
|
|
|
|
public string Join(string seperator, params object[] args)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.Join<DynamicNull>(seperator, args);
|
2011-06-12 12:09:59 -02:00
|
|
|
|
}
|
2011-06-12 13:34:15 -02:00
|
|
|
|
|
2011-07-02 17:27:27 -12:00
|
|
|
|
public HtmlString If(bool test, string valueIfTrue, string valueIfFalse)
|
2011-06-12 13:34:15 -02:00
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.If(test, valueIfTrue, valueIfFalse);
|
2011-06-12 13:34:15 -02:00
|
|
|
|
}
|
2011-07-02 17:27:27 -12:00
|
|
|
|
public HtmlString If(bool test, string valueIfTrue)
|
2011-06-30 11:56:16 -12:00
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.If(test, valueIfTrue);
|
2011-06-30 11:56:16 -12:00
|
|
|
|
}
|
2011-06-12 13:34:15 -02:00
|
|
|
|
|
2011-06-13 07:01:04 -02:00
|
|
|
|
public HtmlTagWrapper Wrap(string tag, string innerText, params HtmlTagWrapperBase[] Children)
|
|
|
|
|
|
{
|
2011-06-13 08:39:32 -02:00
|
|
|
|
var item = Wrap(tag, innerText, (object)null);
|
2011-06-13 07:01:04 -02:00
|
|
|
|
foreach (var child in Children)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.AddChild(child);
|
|
|
|
|
|
}
|
|
|
|
|
|
return item;
|
|
|
|
|
|
}
|
2011-06-12 15:03:38 -02:00
|
|
|
|
public HtmlTagWrapper Wrap(string tag, string innerText)
|
2011-06-12 19:06:09 -02:00
|
|
|
|
{
|
2011-06-13 08:39:32 -02:00
|
|
|
|
return Wrap(tag, innerText, (object)null);
|
2011-06-12 20:12:52 -02:00
|
|
|
|
}
|
|
|
|
|
|
public HtmlTagWrapper Wrap(string tag, object inner, object anonymousAttributes)
|
|
|
|
|
|
{
|
|
|
|
|
|
string innerText = null;
|
2011-10-16 09:25:20 -13:00
|
|
|
|
if (inner != null && inner.GetType() != typeof(DynamicNull))
|
2011-06-12 20:12:52 -02:00
|
|
|
|
{
|
|
|
|
|
|
innerText = string.Format("{0}", inner);
|
|
|
|
|
|
}
|
|
|
|
|
|
return Wrap(tag, innerText, anonymousAttributes);
|
|
|
|
|
|
}
|
2011-06-13 07:01:04 -02:00
|
|
|
|
|
|
|
|
|
|
public HtmlTagWrapper Wrap(string tag, object inner, object anonymousAttributes, params HtmlTagWrapperBase[] Children)
|
|
|
|
|
|
{
|
|
|
|
|
|
string innerText = null;
|
2011-10-16 09:24:14 -13:00
|
|
|
|
if (inner != null && inner.GetType() != typeof(DynamicNull))
|
2011-06-13 07:01:04 -02:00
|
|
|
|
{
|
|
|
|
|
|
innerText = string.Format("{0}", inner);
|
|
|
|
|
|
}
|
|
|
|
|
|
var item = Wrap(tag, innerText, anonymousAttributes);
|
|
|
|
|
|
foreach (var child in Children)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.AddChild(child);
|
|
|
|
|
|
}
|
|
|
|
|
|
return item;
|
|
|
|
|
|
}
|
2011-06-12 20:12:52 -02:00
|
|
|
|
public HtmlTagWrapper Wrap(string tag, object inner)
|
|
|
|
|
|
{
|
|
|
|
|
|
string innerText = null;
|
2011-10-16 09:24:14 -13:00
|
|
|
|
if (inner != null && inner.GetType() != typeof(DynamicNull))
|
2011-06-12 20:12:52 -02:00
|
|
|
|
{
|
|
|
|
|
|
innerText = string.Format("{0}", inner);
|
|
|
|
|
|
}
|
|
|
|
|
|
return Wrap(tag, innerText, null);
|
2011-06-12 19:06:09 -02:00
|
|
|
|
}
|
|
|
|
|
|
public HtmlTagWrapper Wrap(string tag, string innerText, object anonymousAttributes)
|
2011-06-12 15:03:38 -02:00
|
|
|
|
{
|
|
|
|
|
|
HtmlTagWrapper wrap = new HtmlTagWrapper(tag);
|
2011-06-12 19:06:09 -02:00
|
|
|
|
if (anonymousAttributes != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
wrap.ReflectAttributesFromAnonymousType(anonymousAttributes);
|
|
|
|
|
|
}
|
2011-06-12 20:12:52 -02:00
|
|
|
|
if (!string.IsNullOrWhiteSpace(innerText))
|
|
|
|
|
|
{
|
|
|
|
|
|
wrap.Children.Add(new HtmlTagWrapperTextNode(innerText));
|
|
|
|
|
|
}
|
2011-06-12 15:03:38 -02:00
|
|
|
|
return wrap;
|
|
|
|
|
|
}
|
2011-06-13 07:01:04 -02:00
|
|
|
|
public HtmlTagWrapper Wrap(string tag, string innerText, object anonymousAttributes, params HtmlTagWrapperBase[] Children)
|
|
|
|
|
|
{
|
|
|
|
|
|
HtmlTagWrapper wrap = new HtmlTagWrapper(tag);
|
|
|
|
|
|
if (anonymousAttributes != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
wrap.ReflectAttributesFromAnonymousType(anonymousAttributes);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(innerText))
|
|
|
|
|
|
{
|
|
|
|
|
|
wrap.Children.Add(new HtmlTagWrapperTextNode(innerText));
|
|
|
|
|
|
}
|
|
|
|
|
|
foreach (var child in Children)
|
|
|
|
|
|
{
|
|
|
|
|
|
wrap.AddChild(child);
|
|
|
|
|
|
}
|
|
|
|
|
|
return wrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-06-20 11:11:18 -02:00
|
|
|
|
public HtmlTagWrapper Wrap(bool visible, string tag, string innerText, object anonymousAttributes)
|
2011-06-13 07:01:04 -02:00
|
|
|
|
{
|
2011-06-20 11:11:18 -02:00
|
|
|
|
var item = Wrap(tag, innerText, anonymousAttributes);
|
|
|
|
|
|
item.Visible = visible;
|
|
|
|
|
|
return item;
|
2011-06-13 07:01:04 -02:00
|
|
|
|
}
|
2011-06-20 11:11:18 -02:00
|
|
|
|
public HtmlTagWrapper Wrap(bool visible, string tag, string innerText, object anonymousAttributes, params HtmlTagWrapperBase[] Children)
|
2011-06-13 07:01:04 -02:00
|
|
|
|
{
|
2011-06-20 11:11:18 -02:00
|
|
|
|
var item = Wrap(tag, innerText, anonymousAttributes, Children);
|
|
|
|
|
|
item.Visible = visible;
|
|
|
|
|
|
foreach (var child in Children)
|
2011-06-13 07:01:04 -02:00
|
|
|
|
{
|
2011-06-20 11:11:18 -02:00
|
|
|
|
item.AddChild(child);
|
2011-06-13 07:01:04 -02:00
|
|
|
|
}
|
2011-06-20 11:11:18 -02:00
|
|
|
|
return item;
|
2011-06-13 07:01:04 -02:00
|
|
|
|
}
|
2011-06-26 11:26:02 -12:00
|
|
|
|
public IHtmlString Truncate(IHtmlString html, int length)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Truncate(html.ToHtmlString(), length, true, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Truncate(html.ToHtmlString(), length, addElipsis, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis, bool treatTagsAsContent)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Truncate(html.ToHtmlString(), length, addElipsis, treatTagsAsContent);
|
|
|
|
|
|
}
|
2011-06-27 16:52:04 -12:00
|
|
|
|
public IHtmlString Truncate(DynamicNull html, int length)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new HtmlString(string.Empty);
|
|
|
|
|
|
}
|
|
|
|
|
|
public IHtmlString Truncate(DynamicNull html, int length, bool addElipsis)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new HtmlString(string.Empty);
|
|
|
|
|
|
}
|
|
|
|
|
|
public IHtmlString Truncate(DynamicNull html, int length, bool addElipsis, bool treatTagsAsContent)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new HtmlString(string.Empty);
|
|
|
|
|
|
}
|
2011-06-26 11:26:02 -12:00
|
|
|
|
public IHtmlString Truncate(string html, int length)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Truncate(html, length, true, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
public IHtmlString Truncate(string html, int length, bool addElipsis)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Truncate(html, length, addElipsis, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
public IHtmlString Truncate(string html, int length, bool addElipsis, bool treatTagsAsContent)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.Truncate(html, length, addElipsis, treatTagsAsContent);
|
2011-06-26 11:26:02 -12:00
|
|
|
|
}
|
2011-06-26 09:51:46 -12:00
|
|
|
|
|
|
|
|
|
|
|
2011-08-07 14:07:09 -12:00
|
|
|
|
public HtmlString StripHtml(IHtmlString html)
|
2011-06-26 09:51:46 -12:00
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.StripHtml(html);
|
2011-06-26 09:51:46 -12:00
|
|
|
|
}
|
2011-08-07 14:07:09 -12:00
|
|
|
|
public HtmlString StripHtml(DynamicNull html)
|
2011-06-27 16:52:04 -12:00
|
|
|
|
{
|
2011-08-07 14:07:09 -12:00
|
|
|
|
return new HtmlString(string.Empty);
|
|
|
|
|
|
}
|
|
|
|
|
|
public HtmlString StripHtml(string html)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.StripHtml(html);
|
2011-08-07 14:07:09 -12:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public HtmlString StripHtml(IHtmlString html, List<string> tags)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.StripHtml(html, tags.ToArray());
|
2011-08-07 14:07:09 -12:00
|
|
|
|
}
|
|
|
|
|
|
public HtmlString StripHtml(DynamicNull html, List<string> tags)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new HtmlString(string.Empty);
|
2011-06-27 16:52:04 -12:00
|
|
|
|
}
|
2011-08-07 14:07:09 -12:00
|
|
|
|
public HtmlString StripHtml(string html, List<string> tags)
|
2011-06-26 09:51:46 -12:00
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.StripHtml(html, tags.ToArray());
|
2011-08-07 14:07:09 -12:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public HtmlString StripHtml(IHtmlString html, params string[] tags)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.StripHtml(html, tags);
|
2011-08-07 14:07:09 -12:00
|
|
|
|
}
|
|
|
|
|
|
public HtmlString StripHtml(DynamicNull html, params string[] tags)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new HtmlString(string.Empty);
|
|
|
|
|
|
}
|
|
|
|
|
|
public HtmlString StripHtml(string html, params string[] tags)
|
|
|
|
|
|
{
|
2012-09-14 09:09:23 +07:00
|
|
|
|
return _umbracoHelper.StripHtml(html, tags);
|
2011-06-26 09:51:46 -12:00
|
|
|
|
}
|
|
|
|
|
|
|
2011-05-21 14:34:46 -12:00
|
|
|
|
}
|
|
|
|
|
|
}
|