From 48537bd518c608c28ca084ef3945887fc8753ee5 Mon Sep 17 00:00:00 2001 From: Dmitry Dzygin Date: Wed, 18 Mar 2015 14:03:11 +0100 Subject: [PATCH] Form xml for publishable data items - removing "__PublicationStatus__" and renaming "___PublicationStatusOptions___" -> "PublicationStatusOptions" --- .../DataTypeDescriptorFormsHelper.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Composite/Data/DynamicTypes/DataTypeDescriptorFormsHelper.cs b/Composite/Data/DynamicTypes/DataTypeDescriptorFormsHelper.cs index 4bd6cf9560..5fc95d6e8f 100644 --- a/Composite/Data/DynamicTypes/DataTypeDescriptorFormsHelper.cs +++ b/Composite/Data/DynamicTypes/DataTypeDescriptorFormsHelper.cs @@ -41,8 +41,8 @@ public sealed class DataTypeDescriptorFormsHelper private XElement _bindingsXml; private XElement _panelXml; - private const string PublicationStatusPostFixBindingName = "___PublicationStatus___"; - private const string PublicationStatusOptionsPostFixBindingName = "___PublicationStatusOptions___"; + private const string PublicationStatusPostFixBindingName = "PublicationStatus"; + private const string PublicationStatusOptionsPostFixBindingName = "PublicationStatusOptions"; private static readonly XElement CmsFormElementTemplate; private static readonly XElement CmsBindingsElementTemplate; @@ -250,7 +250,7 @@ public Dictionary GetNewBindings() if (_showPublicationStatusSelector && _dataTypeDescriptor.SuperInterfaces.Contains(typeof(IPublishControlled))) { - newBindings.Add(PublicationStatusBindingName, GenericPublishProcessController.Draft); + newBindings[PublicationStatusBindingName] = GenericPublishProcessController.Draft; newBindings.Add(PublicationStatusOptionsBindingName, GetAvailablePublishingFlowTransitions(EntityToken)); } @@ -356,7 +356,7 @@ public Dictionary GetBindings(IData dataObject, bool allowMandat if (_showPublicationStatusSelector && _dataTypeDescriptor.SuperInterfaces.Contains(typeof(IPublishControlled))) { - bindings.Add(PublicationStatusBindingName, ((IPublishControlled)dataObject).PublicationStatus); + bindings[PublicationStatusBindingName] = ((IPublishControlled)dataObject).PublicationStatus; bindings.Add(PublicationStatusOptionsBindingName, GetAvailablePublishingFlowTransitions(EntityToken)); var intefaceType = dataObject.DataSourceId.InterfaceType; @@ -724,12 +724,6 @@ private void GenerateForm() var publishFieldsXml = new XElement(MainNamespace + "FieldGroup", new XAttribute("Label", Texts.PublicationSettings_FieldGroupLabel)); placeholder.Add(publishFieldsXml); - var publicationStatusBinding = new XElement(CmsNamespace + FormKeyTagNames.Binding, - new XAttribute("name", PublicationStatusBindingName), - new XAttribute("type", typeof(string))); - - _bindingsXml.Add(publicationStatusBinding); - var publicationStatusOptionsBinding = new XElement(CmsNamespace + FormKeyTagNames.Binding, new XAttribute("name", PublicationStatusOptionsBindingName), new XAttribute("type", typeof(object))); @@ -839,7 +833,7 @@ private void GenerateForm() private bool IsNotFieldBinding(string bindingName) { - return bindingName == PublicationStatusBindingName || bindingName == PublicationStatusOptionsBindingName; + return bindingName == PublicationStatusOptionsBindingName; } ///