diff --git a/src/umbraco.editorControls/KeyValuePrevalueEditor.cs b/src/umbraco.editorControls/KeyValuePrevalueEditor.cs deleted file mode 100644 index 8ea71361cd..0000000000 --- a/src/umbraco.editorControls/KeyValuePrevalueEditor.cs +++ /dev/null @@ -1,246 +0,0 @@ -using System; -using System.Collections; -using System.Web.UI; -using System.Web.UI.WebControls; -using ClientDependency.Core; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using System.Collections.Generic; -using System.Web.UI.HtmlControls; - - - -[assembly: System.Web.UI.WebResource("umbraco.editorControls.KeyValuePrevalueEditor.js", "text/js")] -[assembly: System.Web.UI.WebResource("umbraco.editorControls.KeyValuePrevalueEditor.css", "text/css")] -namespace umbraco.editorControls -{ - /// - /// Summary description for KeyValuePrevalueEditor. - /// - - [ClientDependency(ClientDependencyType.Javascript, "Jeditable/jquery.jeditable.js", "UmbracoClient")] - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class KeyValuePrevalueEditor : System.Web.UI.WebControls.PlaceHolder, interfaces.IDataPrevalue - { - - // UI controls - public System.Web.UI.WebControls.DropDownList _dropdownlist; - public TextBox _textbox; - private TextBox _tbhidden; - public umbraco.uicontrols.PropertyPanel pp1 = new umbraco.uicontrols.PropertyPanel(); - public umbraco.uicontrols.PropertyPanel pp2 = new umbraco.uicontrols.PropertyPanel(); - - private Hashtable DeleteButtons = new Hashtable(); - - // referenced datatype - private cms.businesslogic.datatype.BaseDataType _datatype; - - protected static ISqlHelper SqlHelper - { - get { return Application.SqlHelper; } - } - - public KeyValuePrevalueEditor(cms.businesslogic.datatype.BaseDataType DataType) - { - // state it knows its datatypedefinitionid - _datatype = DataType; - - setupChildControls(); - - // Bootstrap delete. - if (System.Web.HttpContext.Current.Request["delete"] != null) { - DeletePrevalue(int.Parse(System.Web.HttpContext.Current.Request["delete"])); - } - - } - - private void DeletePrevalue(int id) { - SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where id = " + id); - } - - private void setupChildControls() - { - _dropdownlist = new DropDownList(); - _dropdownlist.ID = "dbtype"; - - _textbox = new TextBox(); - _textbox.ID = "AddValue"; - - _tbhidden = new TextBox(); - _tbhidden.Attributes.Add("style", "display:none;"); - _tbhidden.CssClass = "valuesHiddenInput"; - - // put the childcontrols in context - ensuring that - // the viewstate is persisted etc. - this.Controls.Add(_dropdownlist); - this.Controls.Add(_textbox); - this.Controls.Add(_tbhidden); - - _dropdownlist.Items.Add(DBTypes.Date.ToString()); - _dropdownlist.Items.Add(DBTypes.Integer.ToString()); - _dropdownlist.Items.Add(DBTypes.Ntext.ToString()); - _dropdownlist.Items.Add(DBTypes.Nvarchar.ToString()); - } - - protected override void OnInit(EventArgs e) { - base.OnInit(e); - - - System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; - - - page.ClientScript.RegisterClientScriptInclude( - "umbraco.editorControls.KeyValuePrevalueEditor.js", - page.ClientScript.GetWebResourceUrl(typeof(KeyValuePrevalueEditor), "umbraco.editorControls.KeyValuePrevalueEditor.js")); - - - HtmlHead head = (HtmlHead)page.Header; - HtmlLink link = new HtmlLink(); - link.Attributes.Add("href", page.ClientScript.GetWebResourceUrl(typeof(KeyValuePrevalueEditor), "umbraco.editorControls.KeyValuePrevalueEditor.css")); - link.Attributes.Add("type", "text/css"); - link.Attributes.Add("rel", "stylesheet"); - head.Controls.Add(link); - - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad (e); - - if (!Page.IsPostBack) - { - _dropdownlist.SelectedValue = _datatype.DBType.ToString(); - - } - - - } - - public Control Editor - { - get - { - return this; - } - } - - public void Save() - { - _datatype.DBType = (cms.businesslogic.datatype.DBTypes)Enum.Parse(typeof(cms.businesslogic.datatype.DBTypes), _dropdownlist.SelectedValue, true); - - //changes in name and sortorder - if (!string.IsNullOrEmpty(_tbhidden.Text)) - { - int so = 0; - foreach (string row in _tbhidden.Text.Split('¶')) - { - if (!string.IsNullOrEmpty(row)) - { - - int id = 0; - - if (row.Split('|').Length == 2 && int.TryParse(row.Split('|')[0], out id) && row.Split('|')[1].Length > 0) - { - - IParameter[] SqlParams = new IParameter[] { - SqlHelper.CreateParameter("@value",row.Split('|')[1]), - SqlHelper.CreateParameter("@sortorder",so), - SqlHelper.CreateParameter("@id",id)}; - SqlHelper.ExecuteNonQuery("update cmsDataTypePreValues set [value] = @value, sortorder = @sortorder where id = @id", SqlParams); - - } - - so++; - } - } - - _tbhidden.Text = ""; - } - - // If the add new prevalue textbox is filled out - add the value to the collection. - if (_textbox.Text != "") - { - - int so = -1; - - try - { - so = SqlHelper.ExecuteScalar("select max(sortorder) from cmsDataTypePreValues where datatypenodeid = @dtdefid", - SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId)); - so++; - } - catch { } - - IParameter[] SqlParams = new IParameter[] { - SqlHelper.CreateParameter("@value",_textbox.Text), - SqlHelper.CreateParameter("@dtdefid",_datatype.DataTypeDefinitionId), - SqlHelper.CreateParameter("@so",so)}; - SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,@so,'')",SqlParams); - _textbox.Text = ""; - - ScriptManager.GetCurrent(Page).SetFocus(_textbox); - } - } - - protected override void Render(HtmlTextWriter writer) - { - writer.Write("
" + ui.Text("dataBaseDatatype") + "
"); - _dropdownlist.RenderControl(writer); - writer.Write("
"); - - List> _prevalues = PrevaluesAsKeyValuePairList; - if (_prevalues.Count > 0) { - writer.Write("
"); - writer.Write(""); - - foreach (KeyValuePair item in _prevalues) - { - writer.Write(""); - } - writer.Write("
TextValue
" + item.Value + " " + item.Key.ToString() + "" + ui.Text("delete") + " sort

"); - } - - writer.Write("
" + ui.Text("addPrevalue") + "
"); - _textbox.RenderControl(writer); - writer.Write("
"); - - _tbhidden.RenderControl(writer); - - - } - - public SortedList Prevalues { - get - { - - SortedList retval = new SortedList(); - IRecordsReader dr = SqlHelper.ExecuteReader( - "Select id, [value] from cmsDataTypePreValues where DataTypeNodeId = " - + _datatype.DataTypeDefinitionId + " order by sortorder"); - - while (dr.Read()) - retval.Add(dr.GetInt("id"), dr.GetString("value")); - dr.Close(); - return retval; - } - } - - public List> PrevaluesAsKeyValuePairList - { - get - { - - List> items = new List>(); - - IRecordsReader dr = SqlHelper.ExecuteReader( - "Select id, [value] from cmsDataTypePreValues where DataTypeNodeId = " - + _datatype.DataTypeDefinitionId + " order by sortorder"); - - while (dr.Read()) - items.Add(new KeyValuePair(dr.GetInt("id"), dr.GetString("value"))); - dr.Close(); - return items; - } - } - } -} diff --git a/src/umbraco.editorControls/checkboxlist/CheckBoxDataType.cs b/src/umbraco.editorControls/checkboxlist/CheckBoxDataType.cs deleted file mode 100644 index 7ca0878c5e..0000000000 --- a/src/umbraco.editorControls/checkboxlist/CheckBoxDataType.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.checkboxlist -{ - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class checkboxListDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private KeyValuePrevalueEditor _prevalueeditor; - - public override interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - _Editor = new checkboxlistEditor(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList); - return _Editor; - } - } - - public override interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new DefaultDataKeyValue(this); - return _baseData; - } - } - - public override string DataTypeName - {get {return "Checkbox list";}} - - public override Guid Id - { - get {return new Guid(Constants.PropertyEditors.CheckBoxList);} - } - - public override interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - } -} \ No newline at end of file diff --git a/src/umbraco.editorControls/checkboxlist/checkboxList.cs b/src/umbraco.editorControls/checkboxlist/checkboxList.cs deleted file mode 100644 index b05fd1bca1..0000000000 --- a/src/umbraco.editorControls/checkboxlist/checkboxList.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.ComponentModel; -using System.Collections; -using System.Collections.Generic; - -namespace umbraco.editorControls.checkboxlist -{ - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class checkboxlistEditor : System.Web.UI.WebControls.CheckBoxList, interfaces.IDataEditor - { - private String _text; - - interfaces.IData _data; - SortedList _prevalues; - public checkboxlistEditor(interfaces.IData Data,SortedList Prevalues) - { - _data = Data; - _prevalues = Prevalues; - } - - List> Prevalues; - public checkboxlistEditor(interfaces.IData Data, List> Prevalues) - { - _data = Data; - this.Prevalues = Prevalues; - } - - public Control Editor { get {return this;}} - - public virtual bool TreatAsRichTextEditor - { - get {return false;} - } - public virtual bool ShowLabel - { - get {return true;} - } - - public void Save() - { - _text = ""; - foreach(ListItem li in base.Items) - { - if (li.Selected) - { - _text += li.Value + ","; - } - } - - if (_text.Length > 0) - _text = _text.Substring(0, _text.Length-1); - _data.Value = _text; - - - } - - protected override void OnInit(EventArgs e) - { - base.OnInit (e); - - if (_data != null && _data.Value != null && _data.Value.ToString() != "") - _text = _data.Value.ToString(); - - if (_prevalues != null) - { - foreach (object key in _prevalues.Keys) - { - ListItem li = new ListItem(_prevalues[key].ToString(), key.ToString()); - - if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1) - li.Selected = true; - - Items.Add(li); - } - } - else if (Prevalues != null) - { - foreach (KeyValuePair item in Prevalues) - { - ListItem li = new ListItem(item.Value, item.Key.ToString()); - - if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1) - li.Selected = true; - - Items.Add(li); - } - } - - } - } -} diff --git a/src/umbraco.editorControls/colorpicker/ColorPickerDataType.cs b/src/umbraco.editorControls/colorpicker/ColorPickerDataType.cs deleted file mode 100644 index 1692f41848..0000000000 --- a/src/umbraco.editorControls/colorpicker/ColorPickerDataType.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.colorpicker -{ - /// - /// Summary description for ColorPickerDataType. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class ColorPickerDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private KeyValuePrevalueEditor _prevalueeditor; - - public override interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - { - _Editor = new colorPicker(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList); - } - return _Editor; - } - } - - public override interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new cms.businesslogic.datatype.DefaultData(this); - return _baseData; - } - } - public override string DataTypeName - { - get {return "Color Picker";} - } - public override Guid Id - { - get { return new Guid(Constants.PropertyEditors.ColorPicker); } - } - - public override interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - } -} diff --git a/src/umbraco.editorControls/colorpicker/colorPicker.cs b/src/umbraco.editorControls/colorpicker/colorPicker.cs deleted file mode 100644 index 509010554d..0000000000 --- a/src/umbraco.editorControls/colorpicker/colorPicker.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.ComponentModel; -using System.Collections; -using Umbraco.Core.IO; -using System.Collections.Generic; - -namespace umbraco.editorControls -{ - /// - /// Summary description for colorPicker. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class colorPicker : System.Web.UI.WebControls.HiddenField, interfaces.IDataEditor - { - private interfaces.IData _data; - private SortedList _prevalues; - - public colorPicker(interfaces.IData Data, SortedList Prevalues) - { - _data = Data; - _prevalues = Prevalues; - } - - List> Prevalues; - public colorPicker(interfaces.IData Data, List> Prevalues) - { - _data = Data; - this.Prevalues = Prevalues; - } - - private ArrayList _colors = new ArrayList(); - - public Control Editor { get { return this; } } - - public colorPicker() - { - } - - public virtual bool TreatAsRichTextEditor - { - get { return false; } - } - public bool ShowLabel - { - get { return true; } - } - - public void Save() - { - _data.Value = this.Value; - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - if (_data != null && _data.Value != null) - this.Value = _data.Value.ToString(); - - _colors.Add(new ListItem("")); - - try - { - if (_prevalues != null) - { - foreach (string val in _prevalues.Values) - { - _colors.Add(new ListItem(val)); - } - } - else if (Prevalues != null) - { - foreach (KeyValuePair item in Prevalues) - { - _colors.Add(new ListItem(item.Value)); - } - } - } - catch { } - } - - protected override void Render(HtmlTextWriter writer) - { - string _bgColor = this.Value; - if (_bgColor == "") - _bgColor = "FFF"; - - base.Render(writer); - writer.WriteLine("
  - "); - - foreach (object color in _colors) - { - string colorValue = color.ToString(); - if (colorValue == "") - colorValue = "FFF"; - - writer.WriteLine(""); - } - - writer.WriteLine("
"); - } - } -} diff --git a/src/umbraco.editorControls/dictionaryPicker/dictionaryPicker.cs b/src/umbraco.editorControls/dictionaryPicker/dictionaryPicker.cs deleted file mode 100644 index ae4721e328..0000000000 --- a/src/umbraco.editorControls/dictionaryPicker/dictionaryPicker.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections; -using System.Web.UI.WebControls; - -namespace umbraco.editorControls.dictionaryPicker -{ - /// - /// Summary description for dictionaryPicker. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class dictionaryPicker : System.Web.UI.WebControls.CheckBoxList, interfaces.IDataEditor - { - private interfaces.IData _data; - private SortedList _prevalues; - private string _text; - - public dictionaryPicker(interfaces.IData Data, SortedList Prevalues) - { - _data = Data; - _prevalues = Prevalues; - } - #region IDataEditor Members - public override String Text - { - get - { - if (_data != null && _data.Value != null) - return _data.Value.ToString(); - else - return ""; - - - } - set {_text = value;} - } - - public bool ShowLabel - { - get - { - // TODO: Add dictionaryPicker.ShowLabel getter implementation - return true; - } - } - - public System.Web.UI.Control Editor - { - get - { - return this; - } - } - - public void Save() - { - _text = ""; - foreach(ListItem li in base.Items) - { - if (li.Selected) - { - _text += li.Value + ","; - } - } - - if (_text.Length > 0) - _text = _text.Substring(0, _text.Length-1); - _data.Value = _text; - } - - public bool TreatAsRichTextEditor - { - get - { - // TODO: Add dictionaryPicker.TreatAsRichTextEditor getter implementation - return false; - } - } - - protected override void OnInit(EventArgs e) - { - base.OnInit (e); - - if (_prevalues.Keys.Count > 0) - { - // Find associated domain - int languageId = 0; - cms.businesslogic.web.Domain[] domains = library.GetCurrentDomains(((umbraco.cms.businesslogic.datatype.DefaultData)_data).NodeId); - if (domains != null) - if (domains.Length > -1) - languageId = domains[0].Language.id; - - - string key = _prevalues.GetByIndex(0).ToString(); - addDictionaries("", key, languageId); - } - } - - private void addDictionaries(string indent, string key, int language) - { - cms.businesslogic.Dictionary.DictionaryItem di = new cms.businesslogic.Dictionary.DictionaryItem(key); - - foreach(cms.businesslogic.Dictionary.DictionaryItem item in di.Children) - { - ListItem li; - if (language != 0) - li = new ListItem(indent + " " + item.Value(language), item.key); - else - li = new ListItem(indent + " " + item.Value(), item.key); - - if ((","+Text+",").IndexOf(","+li.Value.ToString()+",") > -1 && !Page.IsPostBack) - li.Selected = true; - this.Items.Add(li); - addDictionaries(indent + "--", item.key, language); - } - } - - - #endregion - } -} diff --git a/src/umbraco.editorControls/dictionaryPicker/dictionaryPickerDataType.cs b/src/umbraco.editorControls/dictionaryPicker/dictionaryPickerDataType.cs deleted file mode 100644 index f67e5d35b2..0000000000 --- a/src/umbraco.editorControls/dictionaryPicker/dictionaryPickerDataType.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.dictionaryPicker -{ - /// - /// Summary description for dictionaryPickerDataType. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class dictionaryPickerDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private interfaces.IDataPrevalue _prevalueeditor; - - public dictionaryPickerDataType() - { - // - // TODO: Add constructor logic here - // - } - #region IDataType Members - - public override umbraco.interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new cms.businesslogic.datatype.DefaultData(this); - return _baseData; - } - } - - public override Guid Id - { - get - { - // TODO: Add dictionaryPickerDataType.Id getter implementation - return new Guid(Constants.PropertyEditors.DictionaryPicker); - } - } - - public override umbraco.interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - _Editor = new dictionaryPicker(Data, ((KeyValuePrevalueEditor)PrevalueEditor).Prevalues); - return _Editor; - } - } - - - public override string DataTypeName - { - get - { - // TODO: Add dictionaryPickerDataType.DataTypeName getter implementation - return "Dictionary Picker"; - } - } - - public override umbraco.interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - - #endregion - } -} diff --git a/src/umbraco.editorControls/dropdownlist/DropDownDataType.cs b/src/umbraco.editorControls/dropdownlist/DropDownDataType.cs deleted file mode 100644 index af05a06030..0000000000 --- a/src/umbraco.editorControls/dropdownlist/DropDownDataType.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.dropdownlist -{ - /// - /// Summary description for ColorPickerDataType. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class DropdownListDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private KeyValuePrevalueEditor _prevalueeditor; - - public override interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - { - _Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList); - } - return _Editor; - } - } - - public override interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new DefaultDataKeyValue(this); - return _baseData; - } - } - public override string DataTypeName - { - get {return "Dropdown list";} - } - - public override Guid Id - { - get { return new Guid(Constants.PropertyEditors.DropDownList); } - } - - public override interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - } -} diff --git a/src/umbraco.editorControls/dropdownlist/dropDownKeysDataType.cs b/src/umbraco.editorControls/dropdownlist/dropDownKeysDataType.cs deleted file mode 100644 index 6f0848ae8d..0000000000 --- a/src/umbraco.editorControls/dropdownlist/dropDownKeysDataType.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.dropdownlist -{ - /// - /// Summary description for ColorPickerDataType. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class DropdownListKeysDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private KeyValuePrevalueEditor _prevalueeditor; - - public override interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - { - _Editor = new dropdown(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList); - } - return _Editor; - } - } - - public override interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new cms.businesslogic.datatype.DefaultData(this); - return _baseData; - } - } - public override string DataTypeName - { - get {return "Dropdown list, publishing keys";} - } - - public override Guid Id - { - get { return new Guid(Constants.PropertyEditors.DropdownlistPublishingKeys); } - } - - public override interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - } -} diff --git a/src/umbraco.editorControls/dropdownlist/dropdown.cs b/src/umbraco.editorControls/dropdownlist/dropdown.cs deleted file mode 100644 index 6b302ef766..0000000000 --- a/src/umbraco.editorControls/dropdownlist/dropdown.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.ComponentModel; -using System.Collections; - -using umbraco.cms.businesslogic; -using umbraco.cms.businesslogic.language; -using System.Collections.Generic; - -namespace umbraco.editorControls -{ - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class dropdown : System.Web.UI.WebControls.DropDownList, interfaces.IDataEditor - { - private interfaces.IData _data; - private SortedList _prevalues; - - public dropdown(interfaces.IData Data, SortedList Prevalues) - { - _data = Data; - _prevalues = Prevalues; - } - - - List> Prevalues; - public dropdown(interfaces.IData Data, List> Prevalues) - { - _data = Data; - this.Prevalues = Prevalues; - } - - - public Control Editor { - get {return this;} - } - - public virtual bool TreatAsRichTextEditor - { - get {return false;} - } - public virtual bool ShowLabel - { - get {return true;} - } - - public void Save() - { - string tmpVal = ""; - if (this.SelectedIndex > 0) - tmpVal = this.SelectedValue; - _data.Value = tmpVal; - } - - protected override void OnInit(EventArgs e) - { - base.OnInit (e); - - if (_prevalues != null) - { - foreach (object key in _prevalues.Keys) - { - this.Items.Add(new ListItem(Dictionary.ReplaceKey(_prevalues[key].ToString()), key.ToString())); - } - - } - else if (Prevalues != null) - { - foreach (KeyValuePair item in Prevalues) - { - this.Items.Add(new ListItem(Dictionary.ReplaceKey(item.Value), item.Key.ToString())); - } - } - - base.Items.Insert(0, new ListItem(ui.Text("choose") + "...","")); - - if (_data != null && _data.Value != null) - this.SelectedValue = _data.Value.ToString(); - } - } -} \ No newline at end of file diff --git a/src/umbraco.editorControls/listbox/ListBoxDataType.cs b/src/umbraco.editorControls/listbox/ListBoxDataType.cs deleted file mode 100644 index fa040d3266..0000000000 --- a/src/umbraco.editorControls/listbox/ListBoxDataType.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.listbox -{ - /// - /// Summary description for ColorPickerDataType. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class ListBoxDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private KeyValuePrevalueEditor _prevalueeditor; - - public override interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - { - _Editor = new dropdownMultiple(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList); - } - return _Editor; - } - } - - public override interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new DefaultDataKeyValue(this); - return _baseData; - } - } - - public override string DataTypeName - { - get {return "Dropdown list multiple";} - } - - public override Guid Id - { - get { return new Guid(Constants.PropertyEditors.DropDownListMultiple); } - } - public override interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - } -} diff --git a/src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs b/src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs deleted file mode 100644 index de6de46bca..0000000000 --- a/src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.listbox -{ - /// - /// Summary description for ColorPickerDataType. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class ListBoxKeysDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private KeyValuePrevalueEditor _prevalueeditor; - - public override interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - { - _Editor = new dropdownMultiple(Data,((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList); - } - return _Editor; - } - } - - public override interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new cms.businesslogic.datatype.DefaultData(this); - return _baseData; - } - } - - public override string DataTypeName - { - get {return "Dropdown list multiple, publish keys";} - } - - public override Guid Id - { - get { return new Guid(Constants.PropertyEditors.DropdownlistMultiplePublishKeys); } - } - public override interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - } -} diff --git a/src/umbraco.editorControls/listbox/dropdownMultiple.cs b/src/umbraco.editorControls/listbox/dropdownMultiple.cs deleted file mode 100644 index b547dc9550..0000000000 --- a/src/umbraco.editorControls/listbox/dropdownMultiple.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.ComponentModel; -using System.Collections; -using System.Collections.Generic; - -namespace umbraco.editorControls -{ - /// - /// Summary description for dropdownMultiple. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class dropdownMultiple : System.Web.UI.WebControls.ListBox, interfaces.IDataEditor - { - private String _text; - - interfaces.IData _data; - SortedList _prevalues; - public dropdownMultiple(interfaces.IData Data,SortedList Prevalues) - { - _data = Data; - _prevalues = Prevalues; - } - - List> Prevalues; - public dropdownMultiple(interfaces.IData Data, List> Prevalues) - { - _data = Data; - this.Prevalues = Prevalues; - } - - public Control Editor { get {return this;}} - - public virtual bool TreatAsRichTextEditor - { - get {return false;} - } - public virtual bool ShowLabel - { - get {return true;} - } - - //public override String Text - //{ - // get { - - // return _data.Value.ToString(); - - // } - // set {_text = value;} - //} - - public void Save() - { - _text = ""; - foreach(ListItem li in base.Items) - { - if (li.Selected) - { - _text += li.Value + ","; - } - } - - if (_text.Length > 0) - _text = _text.Substring(0, _text.Length-1); - _data.Value = _text; - - - } - - protected override void OnInit(EventArgs e) - { - base.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple; - - if (_data != null && _data.Value != null) - _text = _data.Value.ToString(); - - base.OnInit(e); - - if (_prevalues != null) - { - foreach (object key in _prevalues.Keys) - { - ListItem li = new ListItem(_prevalues[key].ToString(), key.ToString()); - - if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1) - li.Selected = true; - - Items.Add(li); - } - } - else if (Prevalues != null) - { - foreach (KeyValuePair item in Prevalues) - { - ListItem li = new ListItem(item.Value, item.Key.ToString()); - - if (("," + _text + ",").IndexOf("," + li.Value.ToString() + ",") > -1) - li.Selected = true; - - Items.Add(li); - } - } - } - } -} diff --git a/src/umbraco.editorControls/radiobuttonlist/RadioButtonListDataType.cs b/src/umbraco.editorControls/radiobuttonlist/RadioButtonListDataType.cs deleted file mode 100644 index f8bc65f0bc..0000000000 --- a/src/umbraco.editorControls/radiobuttonlist/RadioButtonListDataType.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Umbraco.Core; - -namespace umbraco.editorControls.radiobuttonlist -{ - /// - /// Summary description for ColorPickerDataType. - /// - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class RadioButtonListDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType - { - private interfaces.IDataEditor _Editor; - private interfaces.IData _baseData; - private KeyValuePrevalueEditor _prevalueeditor; - - public override interfaces.IDataEditor DataEditor - { - get - { - if (_Editor == null) - { - _Editor = new radiobox(Data, ((KeyValuePrevalueEditor)PrevalueEditor).PrevaluesAsKeyValuePairList); - } - return _Editor; - } - } - - public override interfaces.IData Data - { - get - { - if (_baseData == null) - _baseData = new cms.businesslogic.datatype.DefaultData(this); - return _baseData; - } - } - public override string DataTypeName - { - get {return "Radiobutton list";} - } - public override Guid Id - { - get { return new Guid(Constants.PropertyEditors.RadioButtonList); } - } - - public override interfaces.IDataPrevalue PrevalueEditor - { - get - { - if (_prevalueeditor == null) - _prevalueeditor = new KeyValuePrevalueEditor(this); - return _prevalueeditor; - } - } - } -} diff --git a/src/umbraco.editorControls/radiobuttonlist/radiobox.cs b/src/umbraco.editorControls/radiobuttonlist/radiobox.cs deleted file mode 100644 index 14cb0e804b..0000000000 --- a/src/umbraco.editorControls/radiobuttonlist/radiobox.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.ComponentModel; -using System.Collections; -using System.Collections.Generic; -namespace umbraco.editorControls -{ - [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] - public class radiobox : System.Web.UI.WebControls.RadioButtonList, interfaces.IDataEditor - { - private interfaces.IData _data; - private SortedList _prevalues; - - public radiobox(interfaces.IData Data, SortedList Prevalues) - { - _data = Data; - _prevalues = Prevalues; - } - - List> Prevalues; - public radiobox(interfaces.IData Data, List> Prevalues) - { - _data = Data; - this.Prevalues = Prevalues; - } - - public Control Editor - { - get {return this;} - } - - public virtual bool TreatAsRichTextEditor - { - get {return false;} - } - public virtual bool ShowLabel - { - get {return true;} - } - - public void Save() - { - string tmpVal = ""; - tmpVal = this.SelectedValue; - _data.Value = tmpVal; - } - - protected override void OnInit(EventArgs e) - { - base.OnInit (e); - - if (_prevalues != null) - { - foreach (object key in _prevalues.Keys) - { - this.Items.Add(new ListItem(_prevalues[key].ToString(), key.ToString())); - } - } - else if (Prevalues != null) - { - foreach (KeyValuePair item in Prevalues) - { - this.Items.Add(new ListItem(item.Value, item.Key.ToString())); - } - } - - try { - if (_data != null && _data.Value != null) - this.SelectedValue = _data.Value.ToString(); - } catch {} - } - } -} diff --git a/src/umbraco.editorControls/umbraco.editorControls.csproj b/src/umbraco.editorControls/umbraco.editorControls.csproj index 62ee324b2b..1358a0945b 100644 --- a/src/umbraco.editorControls/umbraco.editorControls.csproj +++ b/src/umbraco.editorControls/umbraco.editorControls.csproj @@ -192,18 +192,6 @@ Code - - Code - - - Code - - - Code - - - Code - @@ -227,15 +215,6 @@ Code - - Code - - - Code - - - - Code @@ -252,24 +231,12 @@ - - Code - Code Code - - Code - - - Code - - - Code - @@ -327,12 +294,6 @@ - - Code - - - Code -