MediaWiki
REL1_37
AlphabeticPager.php
Go to the documentation of this file.
1
<?php
29
abstract
class
AlphabeticPager
extends
IndexPager
{
30
39
public
function
getNavigationBar
() {
40
if
( !$this->
isNavigationBarShown
() ) {
41
return
''
;
42
}
43
44
if
( isset( $this->mNavigationBar ) ) {
45
return
$this->mNavigationBar
;
46
}
47
48
$linkTexts = [
49
'prev'
=> $this->
msg
(
'prevn'
)->numParams( $this->mLimit )->escaped(),
50
'next'
=> $this->
msg
(
'nextn'
)->numParams( $this->mLimit )->escaped(),
51
'first'
=> $this->
msg
(
'page_first'
)->escaped(),
52
'last'
=> $this->
msg
(
'page_last'
)->escaped()
53
];
54
55
$lang
= $this->
getLanguage
();
56
57
$pagingLinks = $this->
getPagingLinks
( $linkTexts );
58
$limitLinks = $this->
getLimitLinks
();
59
$limits =
$lang
->pipeList( $limitLinks );
60
61
$this->mNavigationBar = $this->
msg
(
'parentheses'
)->rawParams(
62
$lang
->pipeList( [ $pagingLinks[
'first'
],
63
$pagingLinks[
'last'
] ] ) )->escaped() .
" "
.
64
$this->
msg
(
'viewprevnext'
)->rawParams( $pagingLinks[
'prev'
],
65
$pagingLinks[
'next'
], $limits )->escaped();
66
67
if
( !is_array( $this->
getIndexField
() ) ) {
68
# Early return to avoid undue nesting
69
return
$this->mNavigationBar
;
70
}
71
72
$extra =
''
;
73
$msgs = $this->
getOrderTypeMessages
();
74
foreach
( $msgs as $order => $msg ) {
75
if
( $extra !==
''
) {
76
$extra .= $this->
msg
(
'pipe-separator'
)->escaped();
77
}
78
79
if
( $order == $this->mOrderType ) {
80
$extra .= $this->
msg
( $msg )->escaped();
81
}
else
{
82
$extra .= $this->
makeLink
(
83
$this->
msg
( $msg )->escaped(),
84
[
'order'
=> $order ]
85
);
86
}
87
}
88
89
if
( $extra !==
''
) {
90
$extra =
' '
. $this->
msg
(
'parentheses'
)->rawParams( $extra )->escaped();
91
$this->mNavigationBar .= $extra;
92
}
93
94
return
$this->mNavigationBar
;
95
}
96
107
protected
function
getOrderTypeMessages
() {
108
return
null
;
109
}
110
}
AlphabeticPager
IndexPager with an alphabetic list and a formatted navigation bar.
Definition
AlphabeticPager.php:29
AlphabeticPager\getOrderTypeMessages
getOrderTypeMessages()
If this supports multiple order type messages, give the message key for enabling each one in getNavig...
Definition
AlphabeticPager.php:107
AlphabeticPager\getNavigationBar
getNavigationBar()
Shamelessly stolen bits from ReverseChronologicalPager, didn't want to do class magic as may be still...
Definition
AlphabeticPager.php:39
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition
ContextSource.php:197
ContextSource\getLanguage
getLanguage()
Definition
ContextSource.php:153
IndexPager
IndexPager is an efficient pager which uses a (roughly unique) index in the data set to implement pag...
Definition
IndexPager.php:74
IndexPager\makeLink
makeLink( $text, array $query=null, $type=null)
Make a self-link.
Definition
IndexPager.php:634
IndexPager\$mNavigationBar
string $mNavigationBar
Definition
IndexPager.php:151
IndexPager\getPagingLinks
getPagingLinks( $linkTexts, $disabledTexts=[])
Get paging links.
Definition
IndexPager.php:806
IndexPager\isNavigationBarShown
isNavigationBarShown()
Returns whether to show the "navigation bar".
Definition
IndexPager.php:788
IndexPager\getIndexField
getIndexField()
Returns the name of the index field.
IndexPager\getLimitLinks
getLimitLinks()
Definition
IndexPager.php:827
$lang
if(!isset( $args[0])) $lang
Definition
testCompression.php:37
includes
pager
AlphabeticPager.php
Generated on Fri Apr 5 2024 23:40:39 for MediaWiki by
1.9.8