2020-08-26 08:05:15 +02:00
|
|
|
|
using System.Collections.Generic;
|
2020-09-22 12:28:56 +02:00
|
|
|
|
using Umbraco.Core.Models;
|
2020-08-25 14:00:59 +02:00
|
|
|
|
using Umbraco.Core.Services;
|
2020-08-26 08:05:15 +02:00
|
|
|
|
using Umbraco.Web.Common.Attributes;
|
|
|
|
|
|
|
2020-09-22 11:07:01 +02:00
|
|
|
|
namespace Umbraco.Web.BackOffice.Controllers
|
2020-08-26 08:05:15 +02:00
|
|
|
|
{
|
|
|
|
|
|
[PluginController("UmbracoApi")]
|
|
|
|
|
|
public class IconController : UmbracoAuthorizedApiController
|
|
|
|
|
|
{
|
2020-09-22 08:58:16 +02:00
|
|
|
|
private readonly IIconService _iconService;
|
2020-08-26 08:05:15 +02:00
|
|
|
|
|
2020-09-22 12:54:51 +02:00
|
|
|
|
public IconController(IIconService iconService)
|
2020-08-26 08:05:15 +02:00
|
|
|
|
{
|
2020-09-22 08:58:16 +02:00
|
|
|
|
_iconService = iconService;
|
2020-08-26 08:05:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets an IconModel containing the icon name and SvgString according to an icon name found at the global icons path
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="iconName"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2020-08-26 08:17:05 +02:00
|
|
|
|
[DetermineAmbiguousActionByPassingParameters]
|
2020-08-26 08:05:15 +02:00
|
|
|
|
public IconModel GetIcon(string iconName)
|
|
|
|
|
|
{
|
2020-09-22 08:58:16 +02:00
|
|
|
|
return _iconService.GetIcon(iconName);
|
2020-08-26 08:05:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets a list of all svg icons found at at the global icons path.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
2020-09-22 08:58:16 +02:00
|
|
|
|
public IList<IconModel> GetAllIcons()
|
2020-08-26 08:05:15 +02:00
|
|
|
|
{
|
2020-09-22 08:58:16 +02:00
|
|
|
|
return _iconService.GetAllIcons();
|
2020-08-26 08:05:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|