WIP dataeditor settings, adds default value option
[TFS Changeset #78719]
This commit is contained in:
@@ -30,8 +30,8 @@ namespace umbraco.editorControls.SettingControls
|
||||
tb.CssClass = "guiInputText guiInputStandardSize";
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(tb.Text) && Prevalues.Count > 0)
|
||||
tb.Text = Prevalues[0];
|
||||
if (string.IsNullOrEmpty(tb.Text) && !string.IsNullOrEmpty(DefaultValue))
|
||||
tb.Text = DefaultValue;
|
||||
|
||||
return tb;
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@ namespace umbraco.cms.businesslogic.datatype
|
||||
public string description;
|
||||
public string type;
|
||||
public string prevalues;
|
||||
public object defaultValue;
|
||||
|
||||
public DataEditorSetting(string name)
|
||||
{
|
||||
this.name = name;
|
||||
description = "";
|
||||
type = "umbraco.editorControls.SettingControls.TextField, umbraco.editorControls";
|
||||
|
||||
prevalues = "";
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ namespace umbraco.cms.businesslogic.datatype
|
||||
Type t = System.Web.Compilation.BuildManager.GetType(type, false);
|
||||
DataEditorSettingType dst = (DataEditorSettingType)System.Activator.CreateInstance(t, true);
|
||||
|
||||
|
||||
if(defaultValue != null)
|
||||
dst.DefaultValue = defaultValue.ToString();
|
||||
|
||||
if (dst != null)
|
||||
dst.Prevalues = GetPrevalues();
|
||||
|
||||
@@ -16,5 +16,7 @@ namespace umbraco.cms.businesslogic.datatype
|
||||
get { return m_prevalues; }
|
||||
set { m_prevalues = value; }
|
||||
}
|
||||
|
||||
public string DefaultValue { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace umbraco.cms.businesslogic.datatype
|
||||
public interface IDataEditorSettingType
|
||||
{
|
||||
string Value { get; set; }
|
||||
string DefaultValue { get; set; }
|
||||
System.Web.UI.Control RenderControl(DataEditorSetting setting);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user