mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Renaming methods to BuildDisplayModel, BuildEditorModel, UpdateEditorModel and models to ItemDisplayModel, ItemEditorModel
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043654
This commit is contained in:
@@ -93,7 +93,7 @@ namespace Orchard.Core.Common.Providers {
|
||||
}
|
||||
|
||||
|
||||
private void GetEditor(GetEditorViewModelContext context, CommonAspect instance) {
|
||||
private void GetEditor(BuildEditorModelContext context, CommonAspect instance) {
|
||||
var currentUser = _authenticationService.GetAuthenticatedUser();
|
||||
if (!_authorizationService.CheckAccess(currentUser, Permissions.ChangeOwner)) {
|
||||
return;
|
||||
@@ -106,7 +106,7 @@ namespace Orchard.Core.Common.Providers {
|
||||
}
|
||||
|
||||
|
||||
private void UpdateEditor(UpdateEditorViewModelContext context, CommonAspect instance) {
|
||||
private void UpdateEditor(UpdateEditorModelContext context, CommonAspect instance) {
|
||||
// this event is hooked so the modified timestamp is changed when an edit-post occurs.
|
||||
// kind of a loose rule of thumb. may not be sufficient
|
||||
instance.Record.ModifiedUtc = _clock.UtcNow;
|
||||
|
@@ -26,14 +26,14 @@ namespace Orchard.Core.Settings.Controllers {
|
||||
public ActionResult Index(string tabName) {
|
||||
var model = new Orchard.Core.Settings.ViewModels.SettingsIndexViewModel {
|
||||
Site = _siteService.GetSiteSettings().As<SiteSettings>() };
|
||||
model.ItemView = _modelManager.GetEditorViewModel(model.Site, tabName);
|
||||
model.EditorModel = _modelManager.BuildEditorModel(model.Site, tabName);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
public ActionResult Index(string tabName, FormCollection input) {
|
||||
var viewModel = new SettingsIndexViewModel { Site = _siteService.GetSiteSettings().As<SiteSettings>() };
|
||||
viewModel.ItemView = _modelManager.UpdateEditorViewModel(viewModel.Site.ContentItem, tabName, this);
|
||||
viewModel.EditorModel = _modelManager.UpdateEditorModel(viewModel.Site.ContentItem, tabName, this);
|
||||
|
||||
if (!TryUpdateModel(viewModel, input.ToValueProvider())) {
|
||||
return View(viewModel);
|
||||
|
@@ -8,7 +8,7 @@ using Orchard.Core.Settings.Models;
|
||||
namespace Orchard.Core.Settings.ViewModels {
|
||||
public class SettingsIndexViewModel : AdminViewModel {
|
||||
public SiteSettings Site { get; set; }
|
||||
public ItemEditorViewModel ItemView { get; set; }
|
||||
public ItemEditorModel EditorModel { get; set; }
|
||||
|
||||
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
|
@@ -18,6 +18,6 @@
|
||||
</ol>
|
||||
|
||||
|
||||
<% foreach(var e in Model.ItemView.Editors) {%>
|
||||
<% foreach(var e in Model.EditorModel.Editors) {%>
|
||||
<%=Html.EditorFor(m => e.Model, e.TemplateName, e.Prefix)%>
|
||||
<%} %>
|
||||
|
Reference in New Issue
Block a user