2016-08-11 04:10:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\CMS\BatchActions;
|
|
|
|
|
|
|
|
use SilverStripe\ORM\SS_List;
|
2016-10-25 02:22:31 +02:00
|
|
|
use SilverStripe\Admin\CMSBatchAction;
|
2016-08-11 04:10:51 +02:00
|
|
|
|
|
|
|
/**
|
2016-10-25 02:22:31 +02:00
|
|
|
* Delete items batch action.
|
2016-08-11 04:10:51 +02:00
|
|
|
*/
|
2017-01-25 21:59:25 +01:00
|
|
|
class CMSBatchAction_Archive extends CMSBatchAction
|
|
|
|
{
|
|
|
|
public function getActionTitle()
|
|
|
|
{
|
|
|
|
return _t('CMSBatchAction_Archive.TITLE', 'Unpublish and archive');
|
|
|
|
}
|
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,
|
|
|
|
'doArchive',
|
|
|
|
_t('CMSBatchAction_Archive.RESULT', 'Deleted %d pages from draft and live, and sent them to the archive')
|
|
|
|
);
|
|
|
|
}
|
2016-08-11 04:10:51 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
public function applicablePages($ids)
|
|
|
|
{
|
|
|
|
return $this->applicablePagesHelper($ids, 'canArchive');
|
|
|
|
}
|
2016-08-11 04:10:51 +02:00
|
|
|
}
|