")); // opens draggable container for properties on tabs
-
- foreach (var tab in tabs)
- {
- string tabName = tab.GetRawCaption();
- string tabCaption = tabName;
- if (tab.ContentType != _contentType.Id)
- {
- tabCaption += " (inherited from " + new ContentType(tab.ContentType).Text + ")";
- }
-
- PropertyTypes.Controls.Add(new LiteralControl("
Tab: " + tabCaption + "
"));
-
- // fixme - cannot use ParentId anymore - and I have no idea what we are trying to do here ;-(
- //var propertyGroup = propertyTypeGroups.SingleOrDefault(x => x.ParentId == tab.Id);
- //var propertyTypes = (propertyGroup == null
- // ? tab.GetPropertyTypes(_contentType.Id, false)
- // : propertyGroup.GetPropertyTypes()).ToArray();
- var propertyTypes = tab.GetPropertyTypes(_contentType.Id, false).ToArray();
-
- var propertyGroupId = tab.Id;
-
- var propSort = new HtmlInputHidden();
- propSort.ID = "propSort_" + propertyGroupId + "_Content";
- PropertyTypes.Controls.Add(propSort);
- _sortLists.Add(propSort);
-
- if (propertyTypes.Any(x => x.ContentTypeId == _contentType.Id))
- {
- PropertyTypes.Controls.Add(new LiteralControl("
"));
-
- foreach (var pt in propertyTypes)
- {
- //If the PropertyType doesn't belong on this ContentType skip it and continue to the next one
- if (pt.ContentTypeId != _contentType.Id) continue;
-
- cms.businesslogic.datatype.DataTypeDefinition[] filteredDtds;
- var gpw = GetPropertyWrapperForPropertyType(pt, dtds, out filteredDtds);
- gpw.ID = "gpw_" + pt.Id;
- gpw.PropertyType = pt;
- gpw.Tabs = tabs;
- gpw.TabId = propertyGroupId;
- gpw.DataTypeDefinitions = filteredDtds;
- gpw.Delete += gpw_Delete;
- gpw.FullId = "t_" + propertyGroupId + "_Contents_" + +pt.Id;
-
- PropertyTypes.Controls.Add(gpw);
- _genericProperties.Add(gpw);
- if (refresh)
- gpw.GenricPropertyControl.UpdateInterface();
-
- inTab.Add(pt.Id.ToString(CultureInfo.InvariantCulture), "");
- counter++;
- }
-
- PropertyTypes.Controls.Add(new LiteralControl("
"));
- }
- else
- {
- AddNoPropertiesDefinedMessage();
- }
-
- var jsSortable = GetJavaScriptForPropertySorting(propSort.ClientID);
- Page.ClientScript.RegisterStartupScript(this.GetType(), propSort.ClientID, jsSortable, true);
-
- PropertyTypes.Controls.Add(new LiteralControl("
"));
- }
-
- // Generic properties tab
- counter = 0;
- bool propertyTabHasProperties = false;
- var propertiesPh = new PlaceHolder();
- propertiesPh.ID = "propertiesPH";
- PropertyTypes.Controls.Add(new LiteralControl("
Tab: Generic Properties
"));
- PropertyTypes.Controls.Add(propertiesPh);
-
- var propSortGp = new HtmlInputHidden();
- propSortGp.ID = "propSort_general_Content";
- PropertyTypes.Controls.Add(propSortGp);
- _sortLists.Add(propSortGp);
-
- propertiesPh.Controls.Add(new LiteralControl("
"));
- foreach (var pt in _contentType.PropertyTypes)
- {
- //This use to be:
- if (pt.ContentTypeId == _contentType.Id && inTab.ContainsKey(pt.Id.ToString(CultureInfo.InvariantCulture)) == false)
- //But seriously, if it's not on a tab the tabId is 0, it's a lot easier to read IMO
- //if (pt.ContentTypeId == _contentType.Id && pt.TabId == 0)
- {
- cms.businesslogic.datatype.DataTypeDefinition[] filteredDtds;
- var gpw = GetPropertyWrapperForPropertyType(pt, dtds, out filteredDtds);
-
- // Changed by duckie, was:
- // gpw.ID = "gpw_" + editPropertyType.Alias;
- // Which is NOT unique!
- gpw.ID = "gpw_" + pt.Id;
-
- gpw.PropertyType = pt;
- gpw.Tabs = tabs;
- gpw.DataTypeDefinitions = filteredDtds;
- gpw.Delete += new EventHandler(gpw_Delete);
- gpw.FullId = "t_general_Contents_" + pt.Id;
-
- propertiesPh.Controls.Add(gpw);
- _genericProperties.Add(gpw);
- if (refresh)
- gpw.GenricPropertyControl.UpdateInterface();
- inTab.Add(pt.Id, "");
- propertyTabHasProperties = true;
- counter++;
- }
- }
-
- propertiesPh.Controls.Add(new LiteralControl("
"));
-
- var jsSortable_gp = GetJavaScriptForPropertySorting(propSortGp.ClientID);
-
- Page.ClientScript.RegisterStartupScript(this.GetType(), "propSort_gp", jsSortable_gp, true);
-
-
- if (!propertyTabHasProperties)
- {
- AddNoPropertiesDefinedMessage();
- PropertyTypes.Controls.Remove(PropertyTypes.FindControl("propertiesPH"));
- }
- else
- {
- PropertyTypes.Controls.Add(propertiesPh);
- }
-
- PropertyTypes.Controls.Add(new LiteralControl("
")); // closes draggable container for properties on tabs
-
- }
-
- ///