2013-01-17 01:27:14 +01:00
|
|
|
<?php
|
|
|
|
|
2016-07-22 01:32:32 +02:00
|
|
|
namespace SilverStripe\CMS\Reports;
|
|
|
|
|
|
|
|
use SilverStripe\CMS\Model\SiteTree;
|
2016-08-23 04:36:06 +02:00
|
|
|
use SilverStripe\Reports\SS_Report;
|
2016-07-22 01:32:32 +02:00
|
|
|
|
2013-01-17 01:27:14 +01:00
|
|
|
class EmptyPagesReport extends SS_Report {
|
|
|
|
|
|
|
|
public function title() {
|
|
|
|
return _t('SideReport.EMPTYPAGES',"Pages with no content");
|
|
|
|
}
|
|
|
|
|
|
|
|
public function group() {
|
|
|
|
return _t('SideReport.ContentGroupTitle', "Content reports");
|
|
|
|
}
|
|
|
|
|
|
|
|
public function sort() {
|
|
|
|
return 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function sourceRecords($params = null) {
|
|
|
|
return SiteTree::get()->where(
|
|
|
|
"\"ClassName\" != 'RedirectorPage' AND (\"Content\" = '' OR \"Content\" IS NULL OR \"Content\" LIKE '<p></p>' OR \"Content\" LIKE '<p> </p>')"
|
|
|
|
)->sort('Title');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function columns() {
|
|
|
|
return array(
|
|
|
|
"Title" => array(
|
|
|
|
"title" => "Title", // todo: use NestedTitle(2)
|
|
|
|
"link" => true,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2015-11-10 03:23:58 +01:00
|
|
|
}
|