diff --git a/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs b/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs index 66258cf90..a6a179d68 100644 --- a/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs +++ b/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs @@ -1,14 +1,12 @@ using System; using System.Collections.Generic; +using System.Linq; using Orchard.Core.Settings.Descriptor.Records; using Orchard.Data; using Orchard.Environment.Configuration; using Orchard.Environment.Descriptor; using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.Extensions.Models; -using Orchard.Localization; using Orchard.Logging; -using System.Linq; namespace Orchard.Core.Settings.Descriptor { public class ShellDescriptorManager : Component, IShellDescriptorManager { diff --git a/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs b/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs index 4ace41162..5d2a270b1 100644 --- a/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs +++ b/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs @@ -1,17 +1,16 @@ -using System.Linq; +using System; using System.Net; using JetBrains.Annotations; using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; using Orchard.Core.Settings.Models; using Orchard.Core.Settings.ViewModels; +using Orchard.Localization; using Orchard.Localization.Services; using Orchard.Logging; -using Orchard.Settings; -using System; using Orchard.Security; +using Orchard.Settings; using Orchard.UI.Notify; -using Orchard.Localization; namespace Orchard.Core.Settings.Drivers { [UsedImplicitly] @@ -113,5 +112,22 @@ namespace Orchard.Core.Settings.Drivers { return ContentShape("Parts_Settings_SiteSettingsPart", () => shapeHelper.EditorTemplate(TemplateName: "Parts.Settings.SiteSettingsPart", Model: model, Prefix: Prefix)); } + + protected override void Exporting(SiteSettingsPart part, ContentManagement.Handlers.ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("SupportedCultures", string.Join(";", _cultureManager.ListCultures())); + + base.Exporting(part, context); + } + + protected override void Importing(SiteSettingsPart part, ContentManagement.Handlers.ImportContentContext context) { + var supportedCultures = context.Attribute(part.PartDefinition.Name, "SupportedCultures"); + if (supportedCultures != null) { + foreach (var culture in supportedCultures.Split(';')) { + _cultureManager.AddCulture(culture); + } + } + + base.Importing(part, context); + } } } \ No newline at end of file