silverstripe-cms/code/Controllers/CMSSiteTreeFilter_DeletedPages.php

38 lines
893 B
PHP
Raw Permalink Normal View History

<?php
namespace SilverStripe\CMS\Controllers;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Versioned\Versioned;
/**
* Works a bit different than the other filters:
* Shows all pages *including* those deleted from stage and live.
* It does not filter out pages still existing in the different stages.
*/
class CMSSiteTreeFilter_DeletedPages extends CMSSiteTreeFilter
{
2017-01-25 21:59:25 +01:00
/**
* @var string
*/
protected $childrenMethod = "AllHistoricalChildren";
2017-01-25 21:59:25 +01:00
/**
* @var string
*/
protected $numChildrenMethod = 'numHistoricalChildren';
2017-01-25 21:59:25 +01:00
public static function title()
{
2018-02-20 22:32:13 +01:00
return _t(__CLASS__ . '.Title', "All pages, including archived");
2017-01-25 21:59:25 +01:00
}
2017-01-25 21:59:25 +01:00
public function getFilteredPages()
{
$pages = Versioned::get_including_deleted(SiteTree::class);
2017-01-25 21:59:25 +01:00
$pages = $this->applyDefaultFilters($pages);
return $pages;
}
}