Completed
Push — master ( 41d4aa...7dfe14 )
by Damian
02:52
created

SideReport_EmptyPages   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 6
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * @package cms
5
 * @subpackage reports
6
 */
7
class EmptyPagesReport extends SS_Report {
8
9
	public function title() {
10
		return _t('SideReport.EMPTYPAGES',"Pages with no content");
11
	}
12
13
	public function group() {
14
		return _t('SideReport.ContentGroupTitle', "Content reports");
15
	}
16
17
	public function sort() {
18
		return 100;
19
	}
20
21
	public function sourceRecords($params = null) {
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
		return SiteTree::get()->where(
23
			"\"ClassName\" != 'RedirectorPage' AND (\"Content\" = '' OR \"Content\" IS NULL OR \"Content\" LIKE '<p></p>' OR \"Content\" LIKE '<p>&nbsp;</p>')"
24
		)->sort('Title');
25
	}
26
27
	public function columns() {
28
		return array(
29
			"Title" => array(
30
				"title" => "Title", // todo: use NestedTitle(2)
31
				"link" => true,
32
			),
33
		);
34
	}
35
}
36
37
/**
38
 * @deprecated 3.2..4.0
39
 */
40
class SideReport_EmptyPages extends EmptyPagesReport {
41
	public function __construct() {
42
		Deprecation::notice('4.0', 'Use EmptyPagesReport instead');
43
		parent::__construct();
44
	}
45
}
46