Making progress on updating the content manager API fit better with the new dynamic UI composition scheme

- Includes changing display-related implementations (drivers & views) to work with shapes
- Editor implementations still on the old template model
- Orchard.Blogs is currently using a different display type instead of specifying alterations (for Blog and BlogPost)

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-11 02:06:01 -07:00
parent b7c3ada825
commit ddca57edd4
128 changed files with 635 additions and 454 deletions

View File

@@ -22,15 +22,15 @@ namespace Orchard.Core.Localization.Drivers {
_localizationService = localizationService;
}
protected override DriverResult Display(LocalizationPart part, string displayType) {
var model = new ContentLocalizationsViewModel(part) {
Localizations = GetDisplayLocalizations(part)
};
return ContentPartTemplate(model, "Parts/Localization.ContentTranslations", TemplatePrefix).LongestMatch(displayType, "Summary", "SummaryAdmin").Location(part.GetLocation(displayType));
protected override DriverResult Display(LocalizationPart part, string displayType, dynamic shapeHelper) {
var contentTranslations = shapeHelper.Localization_ContentTranslations(ContentPart: part, Localizations: GetDisplayLocalizations(part));
if (!string.IsNullOrWhiteSpace(displayType))
contentTranslations.Metadata.Type = string.Format("{0}.{1}", contentTranslations.Metadata.Type, displayType);
var location = part.GetLocation(displayType);
return ContentShape(contentTranslations).Location(location);
}
protected override DriverResult Editor(LocalizationPart part) {
protected override DriverResult Editor(LocalizationPart part, dynamic shapeHelper) {
var localizations = GetEditorLocalizations(part).ToList();
var model = new EditLocalizationViewModel {
SelectedCulture = part.Culture != null ? part.Culture.Culture : null,
@@ -43,13 +43,13 @@ namespace Orchard.Core.Localization.Drivers {
return ContentPartTemplate(model, "Parts/Localization.Translation", TemplatePrefix).Location(part.GetLocation("Editor"));
}
protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater) {
protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater, dynamic shapeHelper) {
var model = new EditLocalizationViewModel();
if (updater != null && updater.TryUpdateModel(model, TemplatePrefix, null, null)) {
_localizationService.SetContentCulture(part, model.SelectedCulture);
}
return Editor(part);
return Editor(part, shapeHelper);
}
private IEnumerable<LocalizationPart> GetDisplayLocalizations(LocalizationPart part) {