silverstripe-cms/code/BatchActions/CMSBatchAction_Unpublish.php
Damian Mooyman 041d12129a
Fix regressions from namespacing
Update template locations
Add permission codes to cms sections
Code, phpdoc, and typehint cleanup
Split batch actions into files
2016-08-16 11:56:34 +12:00

33 lines
652 B
PHP

<?php
namespace SilverStripe\CMS\BatchActions;
use SilverStripe\Admin\CMSBatchAction;
use SilverStripe\ORM\SS_List;
/**
* Unpublish items batch action.
*
* @package cms
* @subpackage batchaction
*/
class CMSBatchAction_Unpublish extends CMSBatchAction
{
public function getActionTitle()
{
return _t('CMSBatchActions.UNPUBLISH_PAGES', 'Unpublish');
}
public function run(SS_List $pages)
{
return $this->batchaction($pages, 'doUnpublish',
_t('CMSBatchActions.UNPUBLISHED_PAGES', 'Unpublished %d pages')
);
}
public function applicablePages($ids)
{
return $this->applicablePagesHelper($ids, 'canUnpublish', false, true);
}
}