2016-08-11 04:10:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\CMS\BatchActions;
|
|
|
|
|
|
|
|
use SilverStripe\Admin\CMSBatchAction;
|
|
|
|
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('CMSBatchActions.UNPUBLISH_PAGES', 'Unpublish');
|
|
|
|
}
|
2016-08-11 04:10:51 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
public function run(SS_List $pages)
|
|
|
|
{
|
|
|
|
return $this->batchaction(
|
|
|
|
$pages,
|
|
|
|
'doUnpublish',
|
|
|
|
_t('CMSBatchActions.UNPUBLISHED_PAGES', 'Unpublished %d pages')
|
|
|
|
);
|
|
|
|
}
|
2016-08-11 04:10:51 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
public function applicablePages($ids)
|
|
|
|
{
|
|
|
|
return $this->applicablePagesHelper($ids, 'canUnpublish', false, true);
|
|
|
|
}
|
2016-08-11 04:10:51 +02:00
|
|
|
}
|