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
|
|
|
*/
|
2016-10-25 02:22:31 +02: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
|
|
|
}
|
|
|
|
|
2016-10-25 02:22:31 +02:00
|
|
|
public function run(SS_List $pages) {
|
2016-08-11 04:10:51 +02:00
|
|
|
return $this->batchaction($pages, 'doArchive',
|
2016-10-25 02:22:31 +02:00
|
|
|
_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
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-10-25 02:22:31 +02:00
|
|
|
public function applicablePages($ids) {
|
|
|
|
return $this->applicablePagesHelper($ids, 'canArchive');
|
2016-08-11 04:10:51 +02:00
|
|
|
}
|
|
|
|
}
|