2016-08-11 14:10:51 +12: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-26 09:59:25 +13:00
|
|
|
public function getActionTitle()
|
|
|
|
{
|
2017-04-20 13:45:23 +12:00
|
|
|
return _t('SilverStripe\\Admin\\CMSBatchAction.UNPUBLISH_PAGES', 'Unpublish');
|
2017-01-26 09:59:25 +13:00
|
|
|
}
|
2016-08-11 14:10:51 +12:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
public function run(SS_List $pages)
|
|
|
|
{
|
|
|
|
return $this->batchaction(
|
|
|
|
$pages,
|
|
|
|
'doUnpublish',
|
2017-04-20 13:45:23 +12:00
|
|
|
_t('SilverStripe\\Admin\\CMSBatchAction.UNPUBLISHED_PAGES', 'Unpublished %d pages')
|
2017-01-26 09:59:25 +13:00
|
|
|
);
|
|
|
|
}
|
2016-08-11 14:10:51 +12:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
public function applicablePages($ids)
|
|
|
|
{
|
|
|
|
return $this->applicablePagesHelper($ids, 'canUnpublish', false, true);
|
|
|
|
}
|
2016-08-11 14:10:51 +12:00
|
|
|
}
|