silverstripe-cms/code/BatchActions/CMSBatchAction_Publish.php
Damian Mooyman a87a857a6e
Upgrade code for framework namespaces
Remove @package / @subpackage
Fix inifinite loop in VirtualPage_Controller
2016-09-07 16:29:26 +12:00

30 lines
610 B
PHP

<?php
namespace SilverStripe\CMS\BatchActions;
use SilverStripe\Admin\CMSBatchAction;
use SilverStripe\ORM\SS_List;
/**
* Publish items batch action.
*/
class CMSBatchAction_Publish extends CMSBatchAction
{
public function getActionTitle()
{
return _t('CMSBatchActions.PUBLISH_PAGES', 'Publish');
}
public function run(SS_List $pages)
{
return $this->batchaction($pages, 'publishRecursive',
_t('CMSBatchActions.PUBLISHED_PAGES', 'Published %d pages, %d failures')
);
}
public function applicablePages($ids)
{
return $this->applicablePagesHelper($ids, 'canPublish', true, false);
}
}