silverstripe-cms/code/BatchActions/CMSBatchAction_Archive.php

32 lines
786 B
PHP
Raw Normal View History

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