mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-20 10:47:56 +08:00

- moved publishing control to the Contents module - included some prep for adding bulk actions and filtering to the content item list - publish, unpublish and remove actions need downlevel interstitial pages (functionality only workes w/ JS at the moment) --HG-- branch : dev
28 lines
991 B
C#
28 lines
991 B
C#
using Orchard.ContentManagement;
|
|
|
|
namespace Orchard.Core.Contents.ViewModels {
|
|
public class PublishContentViewModel {
|
|
public PublishContentViewModel(ContentItem contentItem) {
|
|
ContentItem = contentItem;
|
|
}
|
|
|
|
public ContentItem ContentItem { get; private set; }
|
|
|
|
public bool IsPublished {
|
|
get { return ContentItem.VersionRecord != null && ContentItem.VersionRecord.Published; }
|
|
}
|
|
|
|
public bool HasDraft {
|
|
get {
|
|
return (
|
|
(ContentItem.VersionRecord != null)
|
|
&& ((ContentItem.VersionRecord.Published == false)
|
|
|| (ContentItem.VersionRecord.Published && ContentItem.VersionRecord.Latest == false)));
|
|
}
|
|
}
|
|
|
|
public bool HasPublished {
|
|
get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; }
|
|
}
|
|
}
|
|
} |