Skip to content

Commit

Permalink
Form xml for publishable data items - removing "__PublicationStatus__…
Browse files Browse the repository at this point in the history
…" and renaming "___PublicationStatusOptions___" -> "PublicationStatusOptions"
  • Loading branch information
napernik committed Mar 18, 2015
1 parent 8532e5b commit 48537bd
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions Composite/Data/DynamicTypes/DataTypeDescriptorFormsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -250,7 +250,7 @@ public Dictionary<string, object> GetNewBindings()
if (_showPublicationStatusSelector &&
_dataTypeDescriptor.SuperInterfaces.Contains(typeof(IPublishControlled)))
{
newBindings.Add(PublicationStatusBindingName, GenericPublishProcessController.Draft);
newBindings[PublicationStatusBindingName] = GenericPublishProcessController.Draft;
newBindings.Add(PublicationStatusOptionsBindingName, GetAvailablePublishingFlowTransitions(EntityToken));
}

Expand Down Expand Up @@ -356,7 +356,7 @@ public Dictionary<string, object> 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;
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -839,7 +833,7 @@ private void GenerateForm()

private bool IsNotFieldBinding(string bindingName)
{
return bindingName == PublicationStatusBindingName || bindingName == PublicationStatusOptionsBindingName;
return bindingName == PublicationStatusOptionsBindingName;
}

/// <exclude />
Expand Down

0 comments on commit 48537bd

Please sign in to comment.