2018-06-29 19:52:40 +02:00
|
|
|
|
using Umbraco.Core;
|
|
|
|
|
|
using Umbraco.Core.Logging;
|
|
|
|
|
|
using Umbraco.Core.PropertyEditors;
|
|
|
|
|
|
using Umbraco.Core.Services;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.PropertyEditors
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// A property editor to allow multiple checkbox selection of pre-defined items.
|
|
|
|
|
|
/// </summary>
|
2019-06-07 17:59:38 +01:00
|
|
|
|
[DataEditor(
|
|
|
|
|
|
Constants.PropertyEditors.Aliases.CheckBoxList,
|
|
|
|
|
|
"Checkbox list",
|
|
|
|
|
|
"checkboxlist",
|
|
|
|
|
|
Icon = "icon-bulleted-list",
|
|
|
|
|
|
Group = Constants.PropertyEditors.Groups.Lists)]
|
2018-06-29 19:52:40 +02:00
|
|
|
|
public class CheckBoxListPropertyEditor : DataEditor
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly ILocalizedTextService _textService;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The constructor will setup the property editor based on the attribute if one is found
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public CheckBoxListPropertyEditor(ILogger logger, ILocalizedTextService textService)
|
|
|
|
|
|
: base(logger)
|
|
|
|
|
|
{
|
|
|
|
|
|
_textService = textService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
|
protected override IConfigurationEditor CreateConfigurationEditor() => new ValueListConfigurationEditor(_textService);
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2019-02-12 15:02:27 +11:00
|
|
|
|
protected override IDataValueEditor CreateValueEditor() => new MultipleValueEditor(Logger, Attribute);
|
2018-06-29 19:52:40 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|