mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-22 21:02:08 +08:00
- Pages: adding Unpublish to the service. The content manager needs to have this capability in addition to publish...
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045166
This commit is contained in:
@@ -75,6 +75,14 @@ namespace Orchard.Pages.Controllers {
|
||||
_pageService.Publish(page);
|
||||
}
|
||||
break;
|
||||
case PagesBulkAction.Unpublish:
|
||||
if (!Services.Authorizer.Authorize(Permissions.UnpublishPages, T("Couldn't unpublish page")))
|
||||
return new HttpUnauthorizedResult();
|
||||
foreach (PageEntry entry in checkedEntries) {
|
||||
var page = _pageService.GetLatest(entry.PageId);
|
||||
_pageService.Unpublish(page);
|
||||
}
|
||||
break;
|
||||
case PagesBulkAction.Delete:
|
||||
if (!Services.Authorizer.Authorize(Permissions.DeletePages, T("Couldn't delete page")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Orchard.Pages {
|
||||
|
||||
public string PackageName {
|
||||
get {
|
||||
return "NewPages";
|
||||
return "Pages";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Orchard.Pages.Services {
|
||||
Page Create(bool publishNow);
|
||||
void Delete(Page page);
|
||||
void Publish(Page page);
|
||||
void Unpublish(Page page);
|
||||
}
|
||||
|
||||
public enum PageStatus {
|
||||
|
||||
@@ -69,5 +69,9 @@ namespace Orchard.Pages.Services {
|
||||
public void Publish(Page page) {
|
||||
_contentManager.Publish(page.ContentItem);
|
||||
}
|
||||
|
||||
public void Unpublish(Page page) {
|
||||
//_contentManager.Unpublish(page.ContentItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ namespace Orchard.Pages.ViewModels {
|
||||
public enum PagesBulkAction {
|
||||
None,
|
||||
PublishNow,
|
||||
Unpublish,
|
||||
Delete
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
<select id="publishActions" name="<%=Html.NameOf(m => m.Options.BulkAction) %>">
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, PagesBulkAction.None, "Choose action...") %>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, PagesBulkAction.PublishNow, "Publish Now") %>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, PagesBulkAction.Unpublish, "Unpublish") %>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, PagesBulkAction.Delete, "Delete") %>
|
||||
</select>
|
||||
<input class="button" type="submit" name="submit.BulkEdit" value="Apply" />
|
||||
|
||||
Reference in New Issue
Block a user