silverstripe-cms/code/BatchActions/CMSBatchAction_Unpublish.php

33 lines
738 B
PHP
Raw Normal View History

<?php
namespace SilverStripe\CMS\BatchActions;
use SilverStripe\Admin\CMSBatchAction;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\ORM\SS_List;
/**
* Unpublish items batch action.
*/
class CMSBatchAction_Unpublish extends CMSBatchAction
{
2017-01-25 21:59:25 +01:00
public function getActionTitle()
{
return _t(__CLASS__ . '.UNPUBLISH_PAGES', 'Unpublish');
2017-01-25 21:59:25 +01:00
}
public function run(SS_List $pages): HTTPResponse
2017-01-25 21:59:25 +01:00
{
return $this->batchaction(
$pages,
'doUnpublish',
_t(__CLASS__ . '.UNPUBLISHED_PAGES', 'Unpublished %d pages')
2017-01-25 21:59:25 +01:00
);
}
2017-01-25 21:59:25 +01:00
public function applicablePages($ids)
{
return $this->applicablePagesHelper($ids, 'canUnpublish', false, true);
}
}