Moved the content item publishing option functionality (save draft, publish and schedule) out into it's own Orchard.Core module (PublishLater)

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-14 15:31:43 -07:00
parent 4aec86a4fa
commit 881b71db4b
58 changed files with 334 additions and 205 deletions

View File

@@ -3,9 +3,11 @@ using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Common.Models;
using Orchard.Core.Contents.ViewModels;
using Orchard.Core.PublishLater.Models;
using Orchard.Data;
using Orchard.Localization;
using Orchard.Logging;
@@ -124,7 +126,7 @@ namespace Orchard.Core.Contents.Controllers {
}
//need to go about this differently - to know when to publish (IPlublishableAspect ?)
if (!contentItem.Has<CommonAspect>())
if (!contentItem.Has<IPublishingControlAspect>())
_contentManager.Publish(contentItem);
_notifier.Information(T("Created content item"));
@@ -161,6 +163,10 @@ namespace Orchard.Core.Contents.Controllers {
return View("Edit", model);
}
//need to go about this differently - to know when to publish (IPlublishableAspect ?)
if (!contentItem.Has<IPublishingControlAspect>())
_contentManager.Publish(contentItem);
return RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } });
}