MediaWiki
REL1_35
ProtectedTitlesPager.php
Go to the documentation of this file.
1
<?php
25
class
ProtectedTitlesPager
extends
AlphabeticPager
{
26
30
public
$mForm
;
31
35
public
$mConds
;
36
38
private
$level
;
39
41
private
$namespace
;
42
52
public
function
__construct
( $form, $conds,
$type
,
$level
,
$namespace
,
53
$sizetype =
''
, $size = 0
54
) {
55
$this->mForm = $form;
56
$this->mConds = $conds;
57
$this->level =
$level
;
58
$this->
namespace
=
$namespace
;
59
parent::__construct( $form->getContext() );
60
}
61
62
protected
function
getStartBody
() {
63
# Do a link batch query
64
$this->mResult->seek( 0 );
65
$lb =
new
LinkBatch
;
66
67
foreach
( $this->mResult as $row ) {
68
$lb->
add
( $row->pt_namespace, $row->pt_title );
69
}
70
71
$lb->execute();
72
73
return
''
;
74
}
75
79
public
function
getTitle
() {
80
return
$this->mForm->getPageTitle();
81
}
82
83
public
function
formatRow
( $row ) {
84
return
$this->mForm->formatRow( $row );
85
}
86
90
public
function
getQueryInfo
() {
91
$conds =
$this->mConds
;
92
$conds[] =
'pt_expiry > '
. $this->mDb->addQuotes( $this->mDb->timestamp() ) .
93
' OR pt_expiry IS NULL'
;
94
if
( $this->level ) {
95
$conds[
'pt_create_perm'
] =
$this->level
;
96
}
97
98
if
( $this->
namespace
!==
null
) {
99
$conds[] =
'pt_namespace='
. $this->mDb->addQuotes( $this->
namespace
);
100
}
101
102
return
[
103
'tables'
=>
'protected_titles'
,
104
'fields'
=> [
'pt_namespace'
,
'pt_title'
,
'pt_create_perm'
,
105
'pt_expiry'
,
'pt_timestamp'
],
106
'conds'
=> $conds
107
];
108
}
109
110
public
function
getIndexField
() {
111
return
'pt_timestamp'
;
112
}
113
}
AlphabeticPager
IndexPager with an alphabetic list and a formatted navigation bar Stable to extend.
Definition
AlphabeticPager.php:29
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition
LinkBatch.php:35
LinkBatch\add
add( $ns, $dbkey)
Definition
LinkBatch.php:130
ProtectedTitlesPager
Definition
ProtectedTitlesPager.php:25
ProtectedTitlesPager\formatRow
formatRow( $row)
Returns an HTML string representing the result row $row.
Definition
ProtectedTitlesPager.php:83
ProtectedTitlesPager\$mForm
SpecialProtectedtitles $mForm
Definition
ProtectedTitlesPager.php:30
ProtectedTitlesPager\getTitle
getTitle()
Definition
ProtectedTitlesPager.php:79
ProtectedTitlesPager\$level
string null $level
Definition
ProtectedTitlesPager.php:38
ProtectedTitlesPager\getStartBody
getStartBody()
Hook into getBody(), allows text to be inserted at the start.
Definition
ProtectedTitlesPager.php:62
ProtectedTitlesPager\$namespace
int null $namespace
Definition
ProtectedTitlesPager.php:41
ProtectedTitlesPager\__construct
__construct( $form, $conds, $type, $level, $namespace, $sizetype='', $size=0)
Definition
ProtectedTitlesPager.php:52
ProtectedTitlesPager\getIndexField
getIndexField()
Returns the name of the index field.
Definition
ProtectedTitlesPager.php:110
ProtectedTitlesPager\getQueryInfo
getQueryInfo()
Definition
ProtectedTitlesPager.php:90
ProtectedTitlesPager\$mConds
array $mConds
Definition
ProtectedTitlesPager.php:35
SpecialProtectedtitles
A special page that list protected titles from creation.
Definition
SpecialProtectedtitles.php:29
$type
$type
Definition
testCompression.php:52
includes
specials
pagers
ProtectedTitlesPager.php
Generated on Sat Apr 6 2024 00:07:56 for MediaWiki by
1.9.8