mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Move LocationSettings to a separate module
Also go through all existing parts and use the new LocationSettings API to retrieve the location according to the display types. --HG-- branch : dev rename : src/Orchard.Web/Core/Common/Settings/LocationSettingsEditorEvents.cs => src/Orchard.Web/Core/ContentsLocation/Settings/LocationSettingsEditorEvents.cs
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Common.ViewModels;
|
||||
using Orchard.Core.ContentsLocation.Models;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.Services;
|
||||
@@ -35,7 +36,10 @@ namespace Orchard.Core.Common.Drivers {
|
||||
public IOrchardServices Services { get; set; }
|
||||
|
||||
protected override DriverResult Display(CommonAspect part, string displayType) {
|
||||
return ContentPartTemplate(new CommonMetadataViewModel(part), "Parts/Common.Metadata").LongestMatch(displayType, "Summary", "SummaryAdmin").Location("metadata", "5");
|
||||
var location = part.GetLocation(displayType, "metadata", "5");
|
||||
return ContentPartTemplate(new CommonMetadataViewModel(part), "Parts/Common.Metadata")
|
||||
.LongestMatch(displayType, "Summary", "SummaryAdmin")
|
||||
.Location(location);
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(CommonAspect part) {
|
||||
@@ -79,7 +83,8 @@ namespace Orchard.Core.Common.Drivers {
|
||||
}
|
||||
}
|
||||
|
||||
return ContentPartTemplate(model, "Parts/Common.Owner", TemplatePrefix).Location("primary", "20");
|
||||
var location = part.GetLocation("Editor", "primary", "20");
|
||||
return ContentPartTemplate(model, "Parts/Common.Owner", TemplatePrefix).Location(location);
|
||||
}
|
||||
|
||||
DriverResult ContainerEditor(CommonAspect part, IUpdateModel updater) {
|
||||
@@ -106,7 +111,9 @@ namespace Orchard.Core.Common.Drivers {
|
||||
}
|
||||
}
|
||||
}
|
||||
return ContentPartTemplate(model, "Parts/Common.Container", TemplatePrefix).Location("primary", "20.1");
|
||||
|
||||
var location = part.GetLocation("Editor", "primary", "20.1");
|
||||
return ContentPartTemplate(model, "Parts/Common.Container", TemplatePrefix).Location(location);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user