Adding disableFeatures server variable and new DisableTemplate property in DisabledFeatures.cs
This commit is contained in:
@@ -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<string, object>) defaults["umbracoUrls"])["serverVarsJs"] = _urlHelper.Action("ServerVariables", "BackOffice");
|
||||
((Dictionary<string, object>)defaults["umbracoUrls"])["serverVarsJs"] = _urlHelper.Action("ServerVariables", "BackOffice");
|
||||
|
||||
return defaults;
|
||||
}
|
||||
@@ -328,6 +331,14 @@ namespace Umbraco.Web.Editors
|
||||
.ToArray()
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"disabledFeatures", new Dictionary<string,bool>
|
||||
{
|
||||
{
|
||||
"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<TreeAttribute>().Single()
|
||||
let pluginAttr = p.attributes.OfType<PluginControllerAttribute>().Single()
|
||||
select new Dictionary<string, string>
|
||||
let treeAttr = p.attributes.OfType<TreeAttribute>().Single()
|
||||
let pluginAttr = p.attributes.OfType<PluginControllerAttribute>().Single()
|
||||
select new Dictionary<string, string>
|
||||
{
|
||||
{"alias", treeAttr.Alias}, {"packageFolder", pluginAttr.AreaName}
|
||||
}).ToArray();
|
||||
|
||||
@@ -20,5 +20,7 @@ namespace Umbraco.Web.Features
|
||||
/// Gets the disabled controllers.
|
||||
/// </summary>
|
||||
public TypeList<UmbracoApiControllerBase> Controllers { get; private set; }
|
||||
|
||||
public bool DisableTemplate { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user