Tab: " + tabCaption + "
"));
// zb-00036 #29889 : fix property types getter
- var propertyTypes = t.GetPropertyTypes(cType.Id, false);
+ var propertyTypes = t.GetPropertyTypes(_contentType.Id, false);
if (propertyTypes.Length > 0)
{
@@ -452,12 +521,12 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
propertiesPH.Controls.Add(new LiteralControl("
"));
- foreach (cms.businesslogic.propertytype.PropertyType pt in cType.PropertyTypes)
+ foreach (cms.businesslogic.propertytype.PropertyType pt in _contentType.PropertyTypes)
{
//This use to be:
//if (pt.ContentTypeId == cType.Id && !inTab.ContainsKey(pt.Id.ToString())
//But seriously, if it's not on a tab the tabId is 0, it's a lot easier to read IMO
- if (pt.ContentTypeId == cType.Id && pt.TabId == 0)
+ if (pt.ContentTypeId == _contentType.Id && pt.TabId == 0)
{
GenericProperties.GenericPropertyWrapper gpw = new umbraco.controls.GenericProperties.GenericPropertyWrapper();
@@ -519,7 +588,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
{
GenericProperties.GenericPropertyWrapper gpw = (GenericProperties.GenericPropertyWrapper)sender;
gpw.GenricPropertyControl.PropertyType.delete();
- cType = ContentType.GetContentType(cType.Id);
+ _contentType = ContentType.GetContentType(_contentType.Id);
this.bindDataGenericProperties(true);
}
@@ -528,7 +597,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
{
// Data bind create new
- gp.GenricPropertyControl.Tabs = cType.getVirtualTabs;
+ gp.GenricPropertyControl.Tabs = _contentType.getVirtualTabs;
gp.GenricPropertyControl.DataTypeDefinitions = cms.businesslogic.datatype.DataTypeDefinition.GetAll();
DataSet ds = new DataSet();
@@ -551,7 +620,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
dtT.Columns.Add("genericProperties");
Hashtable inTab = new Hashtable();
- foreach (cms.businesslogic.ContentType.TabI tb in cType.getVirtualTabs.ToList())
+ foreach (cms.businesslogic.ContentType.TabI tb in _contentType.getVirtualTabs.ToList())
{
DataRow dr = dtT.NewRow();
dr["TabName"] = tb.GetRawCaption();
@@ -559,7 +628,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
dtT.Rows.Add(dr);
// zb-00036 #29889 : fix property types getter
- foreach (cms.businesslogic.propertytype.PropertyType pt in tb.GetPropertyTypes(cType.Id))
+ foreach (cms.businesslogic.propertytype.PropertyType pt in tb.GetPropertyTypes(_contentType.Id))
{
DataRow dr1 = dtP.NewRow();
dr1["alias"] = pt.Alias;
@@ -578,7 +647,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
dr2["tabid"] = 0;
dtT.Rows.Add(dr2);
- foreach (cms.businesslogic.propertytype.PropertyType pt in cType.PropertyTypes)
+ foreach (cms.businesslogic.propertytype.PropertyType pt in _contentType.PropertyTypes)
{
if (!inTab.ContainsKey(pt.Id.ToString()))
{
@@ -608,14 +677,14 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
if (doesPropertyTypeAliasExist(gpData))
{
string[] info = { gpData.Name, gpData.Type.ToString() };
- cms.businesslogic.propertytype.PropertyType pt = cType.AddPropertyType(cms.businesslogic.datatype.DataTypeDefinition.GetDataTypeDefinition(gpData.Type), Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim()), gpData.Name);
+ cms.businesslogic.propertytype.PropertyType pt = _contentType.AddPropertyType(cms.businesslogic.datatype.DataTypeDefinition.GetDataTypeDefinition(gpData.Type), Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim()), gpData.Name);
pt.Mandatory = gpData.Mandatory;
pt.ValidationRegExp = gpData.Validation;
pt.Description = gpData.Description;
if (gpData.Tab != 0)
{
- cType.SetTabOnPropertyType(pt, gpData.Tab);
+ _contentType.SetTabOnPropertyType(pt, gpData.Tab);
}
gpData.Clear();
@@ -638,9 +707,9 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
pt.Mandatory = gpw.GenricPropertyControl.Mandatory;
pt.DataTypeDefinition = cms.businesslogic.datatype.DataTypeDefinition.GetDataTypeDefinition(gpw.GenricPropertyControl.Type);
if (gpw.GenricPropertyControl.Tab == 0)
- cType.removePropertyTypeFromTab(pt);
+ _contentType.removePropertyTypeFromTab(pt);
else
- cType.SetTabOnPropertyType(pt, gpw.GenricPropertyControl.Tab);
+ _contentType.SetTabOnPropertyType(pt, gpw.GenricPropertyControl.Tab);
pt.Save();
}
@@ -669,8 +738,8 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
private bool doesPropertyTypeAliasExist(GenericProperty gpData)
{
- bool hasAlias = cType.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
- ContentType ct = cType;
+ bool hasAlias = _contentType.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
+ ContentType ct = _contentType;
while (ct.MasterContentType > 0)
{
ct = new ContentType(ct.MasterContentType);
@@ -687,13 +756,13 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
{
if (e.CommandName == "Delete")
{
- cType.DeleteVirtualTab(int.Parse(e.CommandArgument.ToString()));
+ _contentType.DeleteVirtualTab(int.Parse(e.CommandArgument.ToString()));
}
if (e.CommandName == "MoveDown")
{
int TabId = int.Parse(e.CommandArgument.ToString());
- foreach (cms.businesslogic.ContentType.TabI t in cType.getVirtualTabs.ToList())
+ foreach (cms.businesslogic.ContentType.TabI t in _contentType.getVirtualTabs.ToList())
{
if (t.Id == TabId)
{
@@ -705,7 +774,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
if (e.CommandName == "MoveUp")
{
int TabId = int.Parse(e.CommandArgument.ToString());
- foreach (cms.businesslogic.ContentType.TabI t in cType.getVirtualTabs.ToList())
+ foreach (cms.businesslogic.ContentType.TabI t in _contentType.getVirtualTabs.ToList())
{
if (t.Id == TabId)
{
@@ -765,9 +834,9 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
dt.Columns.Add("name");
dt.Columns.Add("id");
dt.Columns.Add("order");
- foreach (cms.businesslogic.ContentType.TabI tb in cType.getVirtualTabs.ToList())
+ foreach (cms.businesslogic.ContentType.TabI tb in _contentType.getVirtualTabs.ToList())
{
- if (tb.ContentType == cType.Id)
+ if (tb.ContentType == _contentType.Id)
{
DataRow dr = dt.NewRow();
dr["name"] = tb.GetRawCaption();
@@ -847,8 +916,8 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
{
if (txtNewTab.Text.Trim() != "")
{
- cType.AddVirtualTab(txtNewTab.Text);
- cType = new ContentType(cType.Id);
+ _contentType.AddVirtualTab(txtNewTab.Text);
+ _contentType = new ContentType(_contentType.Id);
SaveClickEventArgs ea = new SaveClickEventArgs(ui.Text("contentTypeTabCreated"));
ea.IconType = umbraco.BasePages.BasePage.speechBubbleIcon.success;
@@ -870,7 +939,7 @@ Umbraco.Controls.TabView.onActiveTabChange(function(tabviewid, tabid, tabs) {
{
if (e.CommandName == "Delete")
{
- cType.DeleteVirtualTab(int.Parse(e.Item.Cells[0].Text));
+ _contentType.DeleteVirtualTab(int.Parse(e.Item.Cells[0].Text));
SaveClickEventArgs ea = new SaveClickEventArgs(ui.Text("contentTypeTabDeleted"));
ea.IconType = umbraco.BasePages.BasePage.speechBubbleIcon.success;
@@ -894,10 +963,10 @@ Umbraco.Controls.TabView.onActiveTabChange(function(tabviewid, tabid, tabs) {
{
tabid = int.Parse(dgi.Cells[0].Text);
tabName = ((TextBox)dgi.FindControl("txtTab")).Text.Replace("'", "''");
- cType.SetTabName(tabid, tabName);
+ _contentType.SetTabName(tabid, tabName);
if (Int32.TryParse(((TextBox)dgi.FindControl("txtSortOrder")).Text, out tabSortOrder))
{
- cType.SetTabSortOrder(tabid, tabSortOrder);
+ _contentType.SetTabSortOrder(tabid, tabSortOrder);
}
}
}
diff --git a/src/umbraco.businesslogic/UmbracoSettings.cs b/src/umbraco.businesslogic/UmbracoSettings.cs
index c7db9fdeb1..1e206dcc16 100644
--- a/src/umbraco.businesslogic/UmbracoSettings.cs
+++ b/src/umbraco.businesslogic/UmbracoSettings.cs
@@ -562,6 +562,18 @@ namespace umbraco
get { return Umbraco.Core.Configuration.UmbracoSettings.MacroErrorBehaviour; }
}
+ ///
+ /// This configuration setting defines how to show icons in the document type editor.
+ /// - ShowDuplicates - Show duplicates in files and sprites. (default and current Umbraco 'normal' behaviour)
+ /// - HideSpriteDuplicates - Show files on disk and hide duplicates from the sprite
+ /// - HideFileDuplicates - Show files in the sprite and hide duplicates on disk
+ ///
+ /// MacroErrorBehaviour enum defining how to show icons in the document type editor.
+ public static IconPickerBehaviour IconPickerBehaviour
+ {
+ get { return Umbraco.Core.Configuration.UmbracoSettings.IconPickerBehaviour; }
+ }
+
///
/// Configuration regarding webservices
///