mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Adding a GetDisplays operation to the content manager system
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041463
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Orchard.Media.Models {
|
||||
Filters.Add(new StorageFilterForRecord<MediaSettingsRecord>(repository) { AutomaticallyCreateMissingRecord = true });
|
||||
}
|
||||
|
||||
protected override void GetEditors(GetContentEditorsContext context) {
|
||||
protected override void GetEditors(GetEditorsContext context) {
|
||||
var model = context.ContentItem.As<MediaSettings>();
|
||||
if (model == null)
|
||||
return;
|
||||
|
@@ -29,7 +29,7 @@ namespace Orchard.Roles.Models {
|
||||
});
|
||||
}
|
||||
|
||||
protected override void GetEditors(GetContentEditorsContext context) {
|
||||
protected override void GetEditors(GetEditorsContext context) {
|
||||
var userRoles = context.ContentItem.As<UserRoles>();
|
||||
if (userRoles != null) {
|
||||
var roles =
|
||||
|
@@ -31,6 +31,7 @@ namespace Orchard.Wikis.Controllers
|
||||
var model = new PageShowViewModel {
|
||||
Page = _contentManager.Get<WikiPage>(id)
|
||||
};
|
||||
model.Displays = _contentManager.GetDisplays(model.Page.ContentItem);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,6 @@ using Orchard.Wikis.Models;
|
||||
namespace Orchard.Wikis.ViewModels {
|
||||
public class PageShowViewModel {
|
||||
public WikiPage Page { get; set; }
|
||||
public IList<ModelTemplate> Chunks { get; set; }
|
||||
public IEnumerable<ModelTemplate> Displays { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,9 @@
|
||||
<div>
|
||||
body
|
||||
</div>
|
||||
<%foreach (var display in Model.Displays) { %>
|
||||
<%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %>
|
||||
<%} %>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<% Html.Include("footer"); %>
|
||||
|
Reference in New Issue
Block a user