Removed obsolete methods in editors and the grid template.
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Mvc.Html;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using System.Web.Mvc;
|
||||
using Umbraco.Web.Templates;
|
||||
using System.IO;
|
||||
using System.Web.Routing;
|
||||
using Umbraco.Core.Exceptions;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Web
|
||||
{
|
||||
@@ -88,59 +79,6 @@ namespace Umbraco.Web
|
||||
return html.Partial(view, model);
|
||||
}
|
||||
|
||||
|
||||
[Obsolete("This should not be used, GetGridHtml methods accepting HtmlHelper as a parameter or GetGridHtml extensions on HtmlHelper should be used instead")]
|
||||
public static MvcHtmlString GetGridHtml(this IPublishedProperty property, string framework = "bootstrap3")
|
||||
{
|
||||
var asString = property.GetValue() as string;
|
||||
if (asString != null && string.IsNullOrEmpty(asString)) return new MvcHtmlString(string.Empty);
|
||||
|
||||
var htmlHelper = CreateHtmlHelper(property.GetValue());
|
||||
return htmlHelper.GetGridHtml(property, framework);
|
||||
}
|
||||
|
||||
[Obsolete("This should not be used, GetGridHtml methods accepting HtmlHelper as a parameter or GetGridHtml extensions on HtmlHelper should be used instead")]
|
||||
public static MvcHtmlString GetGridHtml(this IPublishedContent contentItem)
|
||||
{
|
||||
return GetGridHtml(contentItem, "bodyText", "bootstrap3");
|
||||
}
|
||||
|
||||
[Obsolete("This should not be used, GetGridHtml methods accepting HtmlHelper as a parameter or GetGridHtml extensions on HtmlHelper should be used instead")]
|
||||
public static MvcHtmlString GetGridHtml(this IPublishedContent contentItem, string propertyAlias)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(propertyAlias)) throw new ArgumentNullOrEmptyException(nameof(propertyAlias));
|
||||
|
||||
return GetGridHtml(contentItem, propertyAlias, "bootstrap3");
|
||||
}
|
||||
|
||||
[Obsolete("This should not be used, GetGridHtml methods accepting HtmlHelper as a parameter or GetGridHtml extensions on HtmlHelper should be used instead")]
|
||||
public static MvcHtmlString GetGridHtml(this IPublishedContent contentItem, string propertyAlias, string framework)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(propertyAlias)) throw new ArgumentNullOrEmptyException(nameof(propertyAlias));
|
||||
|
||||
var prop = contentItem.GetProperty(propertyAlias);
|
||||
if (prop == null) throw new NullReferenceException("No property type found with alias " + propertyAlias);
|
||||
var model = prop.GetValue();
|
||||
|
||||
var asString = model as string;
|
||||
if (asString != null && string.IsNullOrEmpty(asString)) return new MvcHtmlString(string.Empty);
|
||||
|
||||
var htmlHelper = CreateHtmlHelper(model);
|
||||
return htmlHelper.GetGridHtml(contentItem, propertyAlias, framework);
|
||||
}
|
||||
|
||||
[Obsolete("This shouldn't need to be used but because the obsolete extension methods above don't have access to the current HtmlHelper, we need to create a fake one, unfortunately however this will not pertain the current views viewdata, tempdata or model state so should not be used")]
|
||||
private static HtmlHelper CreateHtmlHelper(object model)
|
||||
{
|
||||
var cc = new ControllerContext
|
||||
{
|
||||
RequestContext = UmbracoContext.Current.HttpContext.Request.RequestContext
|
||||
};
|
||||
var viewContext = new ViewContext(cc, new FakeView(), new ViewDataDictionary(model), new TempDataDictionary(), new StringWriter());
|
||||
var htmlHelper = new HtmlHelper(viewContext, new ViewPage());
|
||||
return htmlHelper;
|
||||
}
|
||||
|
||||
private class FakeView : IView
|
||||
{
|
||||
public void Render(ViewContext viewContext, TextWriter writer)
|
||||
|
||||
Reference in New Issue
Block a user