Files
Umbraco-CMS/src/Umbraco.Web/Editors/PreviewController.cs

32 lines
1.0 KiB
C#
Raw Normal View History

using System;
using System.Web.Mvc;
using Umbraco.Web.Features;
using Umbraco.Web.Mvc;
namespace Umbraco.Web.Editors
{
[UmbracoAuthorize]
[DisableBrowserCache]
public class PreviewController : Controller
{
private const string ViewsPath = "~/Umbraco/Views/Preview/";
public ActionResult Index()
{
ViewData["DisableDevicePreview"] = FeaturesResolver.Current.Features.Disabled.DevicePreview;
if (string.IsNullOrWhiteSpace(FeaturesResolver.Current.Features.Enabled.ExtendPreviewHtml) == false)
{
ViewData["ExtendPreviewHtml"] = FeaturesResolver.Current.Features.Enabled.ExtendPreviewHtml;
}
return View(ViewsPath + "Index.cshtml");
}
[AllowAnonymous]
public ActionResult Editors(string editor)
{
if (string.IsNullOrEmpty(editor)) throw new ArgumentNullException("editor");
return View(ViewsPath + editor.Replace(".html", string.Empty) + ".cshtml");
}
}
}