diff --git a/src/Umbraco.Web/Editors/StylesheetController.cs b/src/Umbraco.Web.BackOffice/Controllers/StylesheetController.cs similarity index 66% rename from src/Umbraco.Web/Editors/StylesheetController.cs rename to src/Umbraco.Web.BackOffice/Controllers/StylesheetController.cs index 9785644d3f..852bff28c1 100644 --- a/src/Umbraco.Web/Editors/StylesheetController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/StylesheetController.cs @@ -1,10 +1,12 @@ using System.Collections.Generic; using System.Linq; using Umbraco.Core; +using Umbraco.Core.Services; +using Umbraco.Web.Common.Attributes; +using Umbraco.Web.Editors; using Umbraco.Web.Models.ContentEditing; -using Umbraco.Web.Mvc; -namespace Umbraco.Web.Editors +namespace Umbraco.Web.BackOffice.Controllers { /// /// The API controller used for retrieving available stylesheets @@ -12,9 +14,16 @@ namespace Umbraco.Web.Editors [PluginController("UmbracoApi")] public class StylesheetController : UmbracoAuthorizedJsonController { + private readonly IFileService _fileService; + + public StylesheetController(IFileService fileService) + { + _fileService = fileService; + } + public IEnumerable GetAll() { - return Services.FileService.GetStylesheets() + return _fileService.GetStylesheets() .Select(x => new Stylesheet() { Name = x.Alias, @@ -24,7 +33,7 @@ namespace Umbraco.Web.Editors public IEnumerable GetRulesByName(string name) { - var css = Services.FileService.GetStylesheetByName(name.EnsureEndsWith(".css")); + var css = _fileService.GetStylesheetByName(name.EnsureEndsWith(".css")); if (css == null) return Enumerable.Empty(); @@ -32,4 +41,4 @@ namespace Umbraco.Web.Editors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index 5ecb37bc48..05aa602533 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -241,10 +241,10 @@ namespace Umbraco.Web.Editors // "rteApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( // controller => controller.GetConfiguration()) // }, - { - "stylesheetApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( - controller => controller.GetAll()) - }, + // { + // "stylesheetApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( + // controller => controller.GetAll()) + // }, { "memberTypeApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( controller => controller.GetAllTypes()) diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 9f917ca753..e0b901712e 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -345,7 +345,6 @@ -