mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
041d12129a
Update template locations Add permission codes to cms sections Code, phpdoc, and typehint cleanup Split batch actions into files
33 lines
656 B
PHP
33 lines
656 B
PHP
<?php
|
|
|
|
namespace SilverStripe\CMS\BatchActions;
|
|
|
|
use SilverStripe\Admin\CMSBatchAction;
|
|
use SilverStripe\ORM\SS_List;
|
|
|
|
/**
|
|
* Publish items batch action.
|
|
*
|
|
* @package cms
|
|
* @subpackage batchaction
|
|
*/
|
|
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);
|
|
}
|
|
}
|