mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixing up some overlapping changes
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041351
This commit is contained in:
@@ -11,10 +11,10 @@ namespace Orchard.Core.Settings.Controllers {
|
|||||||
[ValidateInput(false)]
|
[ValidateInput(false)]
|
||||||
public class AdminController : Controller, IModelUpdater {
|
public class AdminController : Controller, IModelUpdater {
|
||||||
private readonly ISiteService _siteService;
|
private readonly ISiteService _siteService;
|
||||||
private readonly IModelManager _modelManager;
|
private readonly IContentManager _modelManager;
|
||||||
private readonly INotifier _notifier;
|
private readonly INotifier _notifier;
|
||||||
|
|
||||||
public AdminController(ISiteService siteService, IModelManager modelManager, INotifier notifier) {
|
public AdminController(ISiteService siteService, IContentManager modelManager, INotifier notifier) {
|
||||||
_siteService = siteService;
|
_siteService = siteService;
|
||||||
_modelManager = modelManager;
|
_modelManager = modelManager;
|
||||||
_notifier = notifier;
|
_notifier = notifier;
|
||||||
@@ -26,14 +26,14 @@ namespace Orchard.Core.Settings.Controllers {
|
|||||||
public ActionResult Index() {
|
public ActionResult Index() {
|
||||||
var model = new Orchard.Core.Settings.ViewModels.SettingsIndexViewModel {
|
var model = new Orchard.Core.Settings.ViewModels.SettingsIndexViewModel {
|
||||||
Site = _siteService.GetSiteSettings().As<SiteModel>() };
|
Site = _siteService.GetSiteSettings().As<SiteModel>() };
|
||||||
model.Editors = _modelManager.GetEditors(model.Site);
|
model.Editors = _modelManager.GetEditors(model.Site.ContentItem);
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
[AcceptVerbs(HttpVerbs.Post)]
|
[AcceptVerbs(HttpVerbs.Post)]
|
||||||
public ActionResult Index(FormCollection input) {
|
public ActionResult Index(FormCollection input) {
|
||||||
var viewModel = new SettingsIndexViewModel { Site = _siteService.GetSiteSettings().As<SiteModel>() };
|
var viewModel = new SettingsIndexViewModel { Site = _siteService.GetSiteSettings().As<SiteModel>() };
|
||||||
viewModel.Editors = _modelManager.UpdateEditors(viewModel.Site, this);
|
viewModel.Editors = _modelManager.UpdateEditors(viewModel.Site.ContentItem, this);
|
||||||
|
|
||||||
if (!TryUpdateModel(viewModel, input.ToValueProvider())) {
|
if (!TryUpdateModel(viewModel, input.ToValueProvider())) {
|
||||||
return View(viewModel);
|
return View(viewModel);
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ using Orchard.UI.Models;
|
|||||||
|
|
||||||
namespace Orchard.Core.Settings.ViewModels {
|
namespace Orchard.Core.Settings.ViewModels {
|
||||||
public class SettingsIndexViewModel : AdminViewModel {
|
public class SettingsIndexViewModel : AdminViewModel {
|
||||||
public IModel Site { get; set; }
|
public SiteModel Site { get; set; }
|
||||||
public IEnumerable<ModelTemplate> Editors { get; set; }
|
public IEnumerable<ModelTemplate> Editors { get; set; }
|
||||||
|
|
||||||
[HiddenInput(DisplayValue = false)]
|
[HiddenInput(DisplayValue = false)]
|
||||||
public int Id {
|
public int Id {
|
||||||
get { return Site.Id; }
|
get { return Site.ContentItem.Id; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SiteName {
|
public string SiteName {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ using Orchard.Models.Records;
|
|||||||
using Orchard.UI.Models;
|
using Orchard.UI.Models;
|
||||||
|
|
||||||
namespace Orchard.Media.Models {
|
namespace Orchard.Media.Models {
|
||||||
public class MediaSettings : ModelPartWithRecord<MediaSettingsRecord> {
|
public class MediaSettings : ContentItemPartWithRecord<MediaSettingsRecord> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MediaSettingsRecord : ModelPartRecord {
|
public class MediaSettingsRecord : ContentPartRecordBase {
|
||||||
public virtual string RootMediaFolder { get; set; }
|
public virtual string RootMediaFolder { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ namespace Orchard.Media.Models {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void GetEditors(GetModelEditorsContext context) {
|
protected override void GetEditors(GetModelEditorsContext context) {
|
||||||
var model = context.Instance.As<MediaSettings>();
|
var model = context.ContentItem.As<MediaSettings>();
|
||||||
if (model == null)
|
if (model == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ namespace Orchard.Media.Models {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateEditors(UpdateModelContext context) {
|
protected override void UpdateEditors(UpdateModelContext context) {
|
||||||
var model = context.Instance.As<MediaSettings>();
|
var model = context.ContentItem.As<MediaSettings>();
|
||||||
if (model == null)
|
if (model == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user