https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/6587 - Moved StylesheetController
This commit is contained in:
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 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<Stylesheet> 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<StylesheetRule> GetRulesByName(string name)
|
||||
{
|
||||
var css = Services.FileService.GetStylesheetByName(name.EnsureEndsWith(".css"));
|
||||
var css = _fileService.GetStylesheetByName(name.EnsureEndsWith(".css"));
|
||||
if (css == null)
|
||||
return Enumerable.Empty<StylesheetRule>();
|
||||
|
||||
@@ -32,4 +41,4 @@ namespace Umbraco.Web.Editors
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -241,10 +241,10 @@ namespace Umbraco.Web.Editors
|
||||
// "rteApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl<RichTextPreValueController>(
|
||||
// controller => controller.GetConfiguration())
|
||||
// },
|
||||
{
|
||||
"stylesheetApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl<StylesheetController>(
|
||||
controller => controller.GetAll())
|
||||
},
|
||||
// {
|
||||
// "stylesheetApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl<StylesheetController>(
|
||||
// controller => controller.GetAll())
|
||||
// },
|
||||
{
|
||||
"memberTypeApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl<MemberTypeController>(
|
||||
controller => controller.GetAllTypes())
|
||||
|
||||
@@ -345,7 +345,6 @@
|
||||
<Compile Include="Editors\MacroRenderingController.cs" />
|
||||
<Compile Include="Editors\MemberTypeController.cs" />
|
||||
<Compile Include="Editors\UpdateCheckController.cs" />
|
||||
<Compile Include="Editors\StylesheetController.cs" />
|
||||
<Compile Include="Editors\EntityController.cs" />
|
||||
<Compile Include="Editors\MemberController.cs" />
|
||||
<Compile Include="Editors\CurrentUserController.cs" />
|
||||
|
||||
Reference in New Issue
Block a user