WIP dataeditor settings, adds default value option

[TFS Changeset #78719]
This commit is contained in:
starfighter83
2010-10-21 14:23:57 +00:00
parent 6bfb41999f
commit 4671e462eb
4 changed files with 8 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -16,5 +16,7 @@ namespace umbraco.cms.businesslogic.datatype
get { return m_prevalues; }
set { m_prevalues = value; }
}
public string DefaultValue { get; set; }
}
}

View File

@@ -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);
}
}