diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index d401c1c266..8ba22b8d52 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -13,6 +13,7 @@ using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.IO; +using Umbraco.Web.Features; using Umbraco.Web.HealthCheck; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; @@ -31,6 +32,7 @@ namespace Umbraco.Web.Editors private readonly ApplicationContext _applicationContext; private readonly HttpContextBase _httpContext; private readonly IOwinContext _owinContext; + private readonly DisabledFeatures _disabledFeatures; public BackOfficeServerVariables(UrlHelper urlHelper, ApplicationContext applicationContext, IUmbracoSettingsSection umbracoSettings) { @@ -52,7 +54,8 @@ namespace Umbraco.Web.Editors {"umbracoUrls", new[] {"authenticationApiBaseUrl", "serverVarsJs", "externalLoginsUrl", "currentUserApiBaseUrl"}}, {"umbracoSettings", new[] {"allowPasswordReset", "imageFileTypes", "maxFileSize", "loginBackgroundImage"}}, {"application", new[] {"applicationPath", "cacheBuster"}}, - {"isDebuggingEnabled", new string[] { }} + {"isDebuggingEnabled", new string[] { }}, + {"disabledFeatures", new [] {"disableTemplate"}} }; //now do the filtering... var defaults = GetServerVariables(); @@ -81,7 +84,7 @@ namespace Umbraco.Web.Editors //TODO: This is ultra confusing! this same key is used for different things, when returning the full app when authenticated it is this URL but when not auth'd it's actually the ServerVariables address // so based on compat and how things are currently working we need to replace the serverVarsJs one - ((Dictionary) defaults["umbracoUrls"])["serverVarsJs"] = _urlHelper.Action("ServerVariables", "BackOffice"); + ((Dictionary)defaults["umbracoUrls"])["serverVarsJs"] = _urlHelper.Action("ServerVariables", "BackOffice"); return defaults; } @@ -328,6 +331,14 @@ namespace Umbraco.Web.Editors .ToArray() } } + }, + { + "disabledFeatures", new Dictionary + { + { + "disableTemplate", FeaturesResolver.Current.Features.Disabled.DisableTemplate + } + } } }; return defaultVals; @@ -352,9 +363,9 @@ namespace Umbraco.Web.Editors .ToArray(); return (from p in pluginTreesWithAttributes - let treeAttr = p.attributes.OfType().Single() - let pluginAttr = p.attributes.OfType().Single() - select new Dictionary + let treeAttr = p.attributes.OfType().Single() + let pluginAttr = p.attributes.OfType().Single() + select new Dictionary { {"alias", treeAttr.Alias}, {"packageFolder", pluginAttr.AreaName} }).ToArray(); diff --git a/src/Umbraco.Web/Features/DisabledFeatures.cs b/src/Umbraco.Web/Features/DisabledFeatures.cs index b9d8d0a2d9..75eface65d 100644 --- a/src/Umbraco.Web/Features/DisabledFeatures.cs +++ b/src/Umbraco.Web/Features/DisabledFeatures.cs @@ -20,5 +20,7 @@ namespace Umbraco.Web.Features /// Gets the disabled controllers. /// public TypeList Controllers { get; private set; } + + public bool DisableTemplate { get; set; } } }