2016-08-11 04:10:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\CMS\BatchActions;
|
|
|
|
|
|
|
|
use SilverStripe\Admin\CMSBatchAction;
|
|
|
|
use SilverStripe\ORM\SS_List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Publish items batch action.
|
|
|
|
*/
|
|
|
|
class CMSBatchAction_Publish extends CMSBatchAction
|
|
|
|
{
|
2017-01-25 21:59:25 +01:00
|
|
|
public function getActionTitle()
|
|
|
|
{
|
|
|
|
return _t('CMSBatchActions.PUBLISH_PAGES', 'Publish');
|
|
|
|
}
|
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,
|
|
|
|
'publishRecursive',
|
|
|
|
_t('CMSBatchActions.PUBLISHED_PAGES', 'Published %d pages, %d failures')
|
|
|
|
);
|
|
|
|
}
|
2016-08-11 04:10:51 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
public function applicablePages($ids)
|
|
|
|
{
|
|
|
|
return $this->applicablePagesHelper($ids, 'canPublish', true, false);
|
|
|
|
}
|
2016-08-11 04:10:51 +02:00
|
|
|
}
|