MediaWiki
REL1_31
ProtectedTitlesPager.php
Go to the documentation of this file.
1
<?php
25
class
ProtectedTitlesPager
extends
AlphabeticPager
{
26
27
public
$mForm
,
$mConds
;
28
29
function
__construct
( $form, $conds = [],
$type
, $level, $namespace,
30
$sizetype =
''
, $size = 0
31
) {
32
$this->mForm = $form;
33
$this->mConds = $conds;
34
$this->level = $level;
35
$this->
namespace
= $namespace;
36
$this->size = intval( $size );
37
parent::__construct( $form->getContext() );
38
}
39
40
function
getStartBody
() {
41
# Do a link batch query
42
$this->mResult->seek( 0 );
43
$lb =
new
LinkBatch
;
44
45
foreach
( $this->mResult as $row ) {
46
$lb->
add
( $row->pt_namespace, $row->pt_title );
47
}
48
49
$lb->execute();
50
51
return
''
;
52
}
53
57
function
getTitle
() {
58
return
$this->mForm->getTitle();
59
}
60
61
function
formatRow
( $row ) {
62
return
$this->mForm->formatRow( $row );
63
}
64
68
function
getQueryInfo
() {
69
$conds =
$this->mConds
;
70
$conds[] =
'pt_expiry > '
. $this->mDb->addQuotes( $this->mDb->timestamp() ) .
71
' OR pt_expiry IS NULL'
;
72
if
( $this->level ) {
73
$conds[
'pt_create_perm'
] = $this->level;
74
}
75
76
if
( !is_null( $this->
namespace
) ) {
77
$conds[] =
'pt_namespace='
. $this->mDb->addQuotes( $this->
namespace
);
78
}
79
80
return
[
81
'tables'
=>
'protected_titles'
,
82
'fields'
=> [
'pt_namespace'
,
'pt_title'
,
'pt_create_perm'
,
83
'pt_expiry'
,
'pt_timestamp'
],
84
'conds'
=> $conds
85
];
86
}
87
88
function
getIndexField
() {
89
return
'pt_timestamp'
;
90
}
91
}
AlphabeticPager
IndexPager with an alphabetic list and a formatted navigation bar.
Definition
AlphabeticPager.php:28
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition
LinkBatch.php:34
LinkBatch\add
add( $ns, $dbkey)
Definition
LinkBatch.php:80
ProtectedTitlesPager
Definition
ProtectedTitlesPager.php:25
ProtectedTitlesPager\$mForm
$mForm
Definition
ProtectedTitlesPager.php:27
ProtectedTitlesPager\__construct
__construct( $form, $conds=[], $type, $level, $namespace, $sizetype='', $size=0)
Definition
ProtectedTitlesPager.php:29
ProtectedTitlesPager\formatRow
formatRow( $row)
Abstract formatting function.
Definition
ProtectedTitlesPager.php:61
ProtectedTitlesPager\getTitle
getTitle()
Definition
ProtectedTitlesPager.php:57
ProtectedTitlesPager\getStartBody
getStartBody()
Hook into getBody(), allows text to be inserted at the start.
Definition
ProtectedTitlesPager.php:40
ProtectedTitlesPager\$mConds
$mConds
Definition
ProtectedTitlesPager.php:27
ProtectedTitlesPager\getIndexField
getIndexField()
This function should be overridden to return the name of the index fi- eld.
Definition
ProtectedTitlesPager.php:88
ProtectedTitlesPager\getQueryInfo
getQueryInfo()
Definition
ProtectedTitlesPager.php:68
$type
$type
Definition
testCompression.php:48
includes
specials
pagers
ProtectedTitlesPager.php
Generated on Mon Nov 25 2024 15:35:24 for MediaWiki by
1.10.0