silverstripe-cms/code/Reports/EmptyPagesReport.php

51 lines
1.0 KiB
PHP
Raw Normal View History

<?php
2016-07-22 11:32:32 +12:00
namespace SilverStripe\CMS\Reports;
use SilverStripe\CMS\Model\RedirectorPage;
2016-07-22 11:32:32 +12:00
use SilverStripe\CMS\Model\SiteTree;
2017-11-01 17:19:04 +13:00
use SilverStripe\ORM\DataList;
2016-09-09 11:26:24 +12:00
use SilverStripe\Reports\Report;
2016-07-22 11:32:32 +12:00
2017-01-26 09:59:25 +13:00
class EmptyPagesReport extends Report
{
public function title()
{
2020-07-08 10:16:19 +12:00
return _t(__CLASS__.'.EMPTYPAGES', "Pages without content");
2017-01-26 09:59:25 +13:00
}
public function group()
{
2017-05-08 17:57:24 +12:00
return _t(__CLASS__.'.ContentGroupTitle', "Content reports");
2017-01-26 09:59:25 +13:00
}
public function sort()
{
return 100;
}
2017-11-01 17:19:04 +13:00
/**
* Gets the source records
*
* @param array $params
2024-01-19 10:00:46 +13:00
* @return DataList<SiteTree>
2017-11-01 17:19:04 +13:00
*/
2017-01-26 09:59:25 +13:00
public function sourceRecords($params = null)
{
return SiteTree::get()
2017-11-01 17:19:04 +13:00
->exclude('ClassName', RedirectorPage::class)
->filter('Content', [null, '', '<p></p>', '<p>&nbsp;</p>'])
->sort('Title');
2017-01-26 09:59:25 +13:00
}
public function columns()
{
return [
"Title" => [
2023-10-12 12:51:50 +13:00
"title" => "Title",
2017-01-26 09:59:25 +13:00
"link" => true,
],
];
2017-01-26 09:59:25 +13:00
}
2015-11-10 15:23:58 +13:00
}