Changes the explicit paramet editor implementations to simply use the already created property editors, updates the legacy parameter editor mappings and adjusts the resolver to use the mappings if one is not found.
This commit is contained in:
@@ -69,6 +69,7 @@ namespace Umbraco.Core
|
||||
|
||||
//Create the legacy prop-eds mapping
|
||||
LegacyPropertyEditorIdToAliasConverter.CreateMappingsForCoreEditors();
|
||||
LegacyParameterEditorAliasConverter.CreateMappingsForCoreEditors();
|
||||
|
||||
//create database and service contexts for the app context
|
||||
var dbFactory = new DefaultDatabaseFactory(GlobalSettings.UmbracoConnectionName);
|
||||
|
||||
@@ -84,6 +84,16 @@ namespace Umbraco.Core.PropertyEditors
|
||||
/// </summary>
|
||||
internal static void CreateMappingsForCoreEditors()
|
||||
{
|
||||
//All of these map to the content picker
|
||||
CreateMap("contentSubs", Constants.PropertyEditors.ContentPickerAlias);
|
||||
CreateMap("contentRandom", Constants.PropertyEditors.ContentPickerAlias);
|
||||
CreateMap("contentPicker", Constants.PropertyEditors.ContentPickerAlias);
|
||||
CreateMap("contentTree", Constants.PropertyEditors.ContentPickerAlias);
|
||||
CreateMap("contentAll", Constants.PropertyEditors.ContentPickerAlias);
|
||||
|
||||
CreateMap("textMultiLine", Constants.PropertyEditors.TextboxMultipleAlias);
|
||||
CreateMap("text", Constants.PropertyEditors.TextboxAlias);
|
||||
CreateMap("bool", Constants.PropertyEditors.TrueFalseAlias);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,14 @@ namespace Umbraco.Core.PropertyEditors
|
||||
/// <returns></returns>
|
||||
public IParameterEditor GetByAlias(string alias)
|
||||
{
|
||||
return ParameterEditors.SingleOrDefault(x => x.Alias == alias);
|
||||
var found = ParameterEditors.SingleOrDefault(x => x.Alias == alias);
|
||||
if (found != null) return found;
|
||||
|
||||
//couldn't find one, so try the map
|
||||
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(alias);
|
||||
return mapped == null
|
||||
? null
|
||||
: ParameterEditors.SingleOrDefault(x => x.Alias == mapped);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors.ParameterEditors
|
||||
{
|
||||
[ParameterEditor("textMultiLine", "Textarea", "textarea")]
|
||||
public class TextAreaParameterEditor : ParameterEditor
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors.ParameterEditors
|
||||
{
|
||||
[ParameterEditor("text", "Text", "textbox")]
|
||||
public class TextParameterEditor : ParameterEditor
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors.ParameterEditors
|
||||
{
|
||||
[ParameterEditor("bool", "True/False", "boolean")]
|
||||
public class TrueFalseParameterEditor : ParameterEditor
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
[PropertyEditor(Constants.PropertyEditors.TextboxMultipleAlias, "Textarea", "textarea")]
|
||||
[PropertyEditor(Constants.PropertyEditors.TextboxMultipleAlias, "Textarea", "textarea", IsParameterEditor = true)]
|
||||
public class TextAreaPropertyEditor : PropertyEditor
|
||||
{
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
[PropertyEditor(Constants.PropertyEditors.TextboxAlias, "Textbox", "textbox")]
|
||||
[PropertyEditor(Constants.PropertyEditors.TextboxAlias, "Textbox", "textbox", IsParameterEditor = true)]
|
||||
public class TextboxPropertyEditor : PropertyEditor
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
[PropertyEditor(Constants.PropertyEditors.TrueFalseAlias, "True/False", "boolean")]
|
||||
[PropertyEditor(Constants.PropertyEditors.TrueFalseAlias, "True/False", "boolean", IsParameterEditor = true)]
|
||||
public class TrueFalsePropertyEditor : PropertyEditor
|
||||
{
|
||||
}
|
||||
|
||||
@@ -346,9 +346,6 @@
|
||||
<Compile Include="PropertyEditors\ListViewPropertyEditor.cs" />
|
||||
<Compile Include="PropertyEditors\MemberPickerPropertyEditor.cs" />
|
||||
<Compile Include="PropertyEditors\MultiNodeTreePickerPropertyEditor.cs" />
|
||||
<Compile Include="PropertyEditors\ParameterEditors\TextAreaParameterEditor.cs" />
|
||||
<Compile Include="PropertyEditors\ParameterEditors\TextParameterEditor.cs" />
|
||||
<Compile Include="PropertyEditors\ParameterEditors\TrueFalseParameterEditor.cs" />
|
||||
<Compile Include="PropertyEditors\RelatedLinksPropertyEditor.cs" />
|
||||
<Compile Include="PropertyEditors\RteEmbedController.cs" />
|
||||
<Compile Include="Editors\EntityController.cs" />
|
||||
|
||||
Reference in New Issue
Block a user