-
Notifications
You must be signed in to change notification settings - Fork 4
/
RequestWikiQueuePager.php
97 lines (84 loc) · 1.87 KB
/
RequestWikiQueuePager.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* @author Southparkfan
*/
class RequestWikiQueuePager extends ReverseChronologicalPager {
public $searchConds;
public $specialPage;
public $y;
public $m;
function __construct( $specialPage, $searchConds, $y, $m ) {
parent::__construct();
$this->getDateCond( $y, $m );
$this->searchConds = $searchConds ? $searchConds : array();
$this->specialPage = $specialPage;
}
function formatRow( $row ) {
$comment = Linker::commentBlock( $row->cw_comment );
$user =
Linker::userLink( $row->cw_user, $row->user_name ) .
Linker::userToolLinks( $row->cw_user, $row->user_name );
$sitename = $row->cw_sitename;
$status = $row->cw_status;
$idlink =
Linker::link(
Title::newFromText( 'Special:RequestWikiQueue/' . $row->cw_id ),
"#{$row->cw_id}"
);
return '<li>' .
$this->getLanguage()->timeanddate(
wfTimestamp( TS_MW, $row->cw_timestamp ),
true
) .
' ' .
$this->msg(
'requestwikiqueue-logpagerentry',
$user,
htmlspecialchars( $sitename ),
$idlink,
$this->msg( 'requestwikiqueue-pager-status-' . $status )
)->text() .
$comment .
'</li>';
}
function getStartBody() {
if ( $this->getNumRows() ) {
return '<ul>';
} else {
return '';
}
}
function getEndBody() {
if ( $this->getNumRows() ) {
return '</ul>';
} else {
return '';
}
}
function getEmptyBody() {
return '<p>' . $this->msg( 'requestwikiqueue-norequests' )->escaped() . '</p>';
}
function getIndexField() {
return 'cw_timestamp';
}
function getQueryInfo() {
$this->searchConds[] = 'user_id = cw_user';
return array(
'tables' => array( 'cw_requests', 'user' ),
'fields' => $this->selectFields(),
'conds' => $this->searchConds,
);
}
function selectFields() {
return array(
'cw_id',
'cw_timestamp',
'cw_user',
'cw_sitename',
'cw_private',
'cw_comment',
'cw_status',
'user_name',
);
}
}