2016-08-16 03:22:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\CMS\Controllers;
|
|
|
|
|
2017-03-21 05:26:46 +01:00
|
|
|
use SilverStripe\Versioned\Versioned;
|
2016-08-16 03:22:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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";
|
2016-08-16 03:22:58 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $numChildrenMethod = 'numHistoricalChildren';
|
2016-08-16 03:22:58 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
public static function title()
|
|
|
|
{
|
|
|
|
return _t('CMSSiteTreeFilter_DeletedPages.Title', "All pages, including archived");
|
|
|
|
}
|
2016-08-16 03:22:58 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
public function getFilteredPages()
|
|
|
|
{
|
|
|
|
$pages = Versioned::get_including_deleted('SilverStripe\\CMS\\Model\\SiteTree');
|
|
|
|
$pages = $this->applyDefaultFilters($pages);
|
|
|
|
return $pages;
|
|
|
|
}
|
2016-08-16 03:22:58 +02:00
|
|
|
}
|