mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#17399: Adding an RSS feed entry to lists
Work Item: 17399 --HG-- branch : 1.x
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Containers.Extensions;
|
||||
using Orchard.Core.Containers.Models;
|
||||
using Orchard.Core.Feeds;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Mvc;
|
||||
@@ -18,16 +20,19 @@ namespace Orchard.Core.Containers.Controllers {
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IContainersPathConstraint _containersPathConstraint;
|
||||
private readonly ISiteService _siteService;
|
||||
private readonly IFeedManager _feedManager;
|
||||
|
||||
public ItemController(
|
||||
IContentManager contentManager,
|
||||
IContainersPathConstraint containersPathConstraint,
|
||||
IShapeFactory shapeFactory,
|
||||
ISiteService siteService) {
|
||||
ISiteService siteService,
|
||||
IFeedManager feedManager) {
|
||||
|
||||
_contentManager = contentManager;
|
||||
_containersPathConstraint = containersPathConstraint;
|
||||
_siteService = siteService;
|
||||
_feedManager = feedManager;
|
||||
Shape = shapeFactory;
|
||||
}
|
||||
|
||||
@@ -61,6 +66,8 @@ namespace Orchard.Core.Containers.Controllers {
|
||||
var descendingOrder = container.As<ContainerPart>().Record.OrderByDirection == (int) OrderByDirection.Descending;
|
||||
query = query.OrderBy(container.As<ContainerPart>().Record.OrderByProperty, descendingOrder);
|
||||
|
||||
_feedManager.Register(container.As<RoutePart>().Title, "rss", new RouteValueDictionary { { "containerid", container.Id } });
|
||||
|
||||
Pager pager = new Pager(_siteService.GetSiteSettings(), pagerParameters);
|
||||
pager.PageSize = pagerParameters.PageSize != null && container.As<ContainerPart>().Record.Paginated
|
||||
? pager.PageSize
|
||||
|
||||
Reference in New Issue
Block a user