silverstripe-cms/code/BatchActions/CMSBatchAction_Archive.php
2017-04-27 11:43:04 +12:00

32 lines
786 B
PHP

<?php
namespace SilverStripe\CMS\BatchActions;
use SilverStripe\ORM\SS_List;
use SilverStripe\Admin\CMSBatchAction;
/**
* Delete items batch action.
*/
class CMSBatchAction_Archive extends CMSBatchAction
{
public function getActionTitle()
{
return _t('SilverStripe\\CMS\\BatchActions\\CMSBatchAction_Archive.TITLE', 'Unpublish and archive');
}
public function run(SS_List $pages)
{
return $this->batchaction(
$pages,
'doArchive',
_t('SilverStripe\\CMS\\BatchActions\\CMSBatchAction_Archive.RESULT', 'Deleted %d pages from draft and live, and sent them to the archive')
);
}
public function applicablePages($ids)
{
return $this->applicablePagesHelper($ids, 'canArchive');
}
}