silverstripe-cms/code/BatchActions/CMSBatchAction_Publish.php

32 lines
735 B
PHP
Raw Normal View History

<?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()
{
2017-04-20 03:45:23 +02:00
return _t('SilverStripe\\Admin\\CMSBatchAction.PUBLISH_PAGES', 'Publish');
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,
'publishRecursive',
2017-04-20 03:45:23 +02:00
_t('SilverStripe\\Admin\\CMSBatchAction.PUBLISHED_PAGES', 'Published %d pages, %d failures')
2017-01-25 21:59:25 +01:00
);
}
2017-01-25 21:59:25 +01:00
public function applicablePages($ids)
{
return $this->applicablePagesHelper($ids, 'canPublish', true, false);
}
}