-
Notifications
You must be signed in to change notification settings - Fork 333
/
EmptyPagesReport.php
51 lines (43 loc) · 1.05 KB
/
EmptyPagesReport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace SilverStripe\CMS\Reports;
use SilverStripe\CMS\Model\RedirectorPage;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\ORM\DataList;
use SilverStripe\Reports\Report;
class EmptyPagesReport extends Report
{
public function title()
{
return _t(__CLASS__.'.EMPTYPAGES', "Pages without content");
}
public function group()
{
return _t(__CLASS__.'.ContentGroupTitle', "Content reports");
}
public function sort()
{
return 100;
}
/**
* Gets the source records
*
* @param array $params
* @return DataList
*/
public function sourceRecords($params = null)
{
return SiteTree::get()
->exclude('ClassName', RedirectorPage::class)
->filter('Content', [null, '', '<p></p>', '<p> </p>'])
->sort('Title');
}
public function columns()
{
return [
"Title" => [
"title" => "Title", // todo: use NestedTitle(2)
"link" => true,
],
];
}
}