summaryrefslogtreecommitdiff
path: root/includes/Pager.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/Pager.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/Pager.php')
-rw-r--r--includes/Pager.php35
1 files changed, 19 insertions, 16 deletions
diff --git a/includes/Pager.php b/includes/Pager.php
index 8ec32ff4..8faec533 100644
--- a/includes/Pager.php
+++ b/includes/Pager.php
@@ -304,20 +304,18 @@ abstract class IndexPager implements Pager {
if ( $query === null ) {
return $text;
}
- if( $type == 'prev' || $type == 'next' ) {
- $attrs = "rel=\"$type\"";
- } elseif( $type == 'first' ) {
- $attrs = "rel=\"start\"";
- } else {
- # HTML 4 has no rel="end" . . .
- $attrs = '';
+
+ $attrs = array();
+ if( in_array( $type, array( 'first', 'prev', 'next', 'last' ) ) ) {
+ # HTML5 rel attributes
+ $attrs['rel'] = $type;
}
if( $type ) {
- $attrs .= " class=\"mw-{$type}link\"" ;
+ $attrs['class'] = "mw-{$type}link";
}
- return $this->getSkin()->makeKnownLinkObj( $this->getTitle(), $text,
- wfArrayToCGI( $query, $this->getDefaultQuery() ), '', '', $attrs );
+ return $this->getSkin()->link( $this->getTitle(), $text,
+ $attrs, $query + $this->getDefaultQuery(), array('noclasses','known') );
}
/**
@@ -532,10 +530,10 @@ abstract class AlphabeticPager extends IndexPager {
$pagingLinks = $this->getPagingLinks( $linkTexts );
$limitLinks = $this->getLimitLinks();
- $limits = implode( ' | ', $limitLinks );
+ $limits = $wgLang->pipeList( $limitLinks );
$this->mNavigationBar =
- "({$pagingLinks['first']} | {$pagingLinks['last']}) " .
+ "(" . $wgLang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
wfMsgHtml( 'viewprevnext', $pagingLinks['prev'],
$pagingLinks['next'], $limits );
@@ -551,7 +549,7 @@ abstract class AlphabeticPager extends IndexPager {
if( $first ) {
$first = false;
} else {
- $extra .= ' | ';
+ $extra .= wfMsgExt( 'pipe-separator' , 'escapenoentities' );
}
if( $order == $this->mOrderType ) {
@@ -612,9 +610,9 @@ abstract class ReverseChronologicalPager extends IndexPager {
$pagingLinks = $this->getPagingLinks( $linkTexts );
$limitLinks = $this->getLimitLinks();
- $limits = implode( ' | ', $limitLinks );
+ $limits = $wgLang->pipeList( $limitLinks );
- $this->mNavigationBar = "({$pagingLinks['first']} | {$pagingLinks['last']}) " .
+ $this->mNavigationBar = "({$pagingLinks['first']}" . wfMsgExt( 'pipe-separator' , 'escapenoentities' ) . "{$pagingLinks['last']}) " .
wfMsgHtml("viewprevnext", $pagingLinks['prev'], $pagingLinks['next'], $limits);
return $this->mNavigationBar;
}
@@ -747,7 +745,8 @@ abstract class TablePager extends IndexPager {
}
function formatRow( $row ) {
- $s = "<tr>\n";
+ $rowClass = $this->getRowClass( $row );
+ $s = "<tr class=\"$rowClass\">\n";
$fieldNames = $this->getFieldNames();
$this->mCurrentRow = $row; # In case formatValue needs to know
foreach ( $fieldNames as $field => $name ) {
@@ -763,6 +762,10 @@ abstract class TablePager extends IndexPager {
return $s;
}
+ function getRowClass($row) {
+ return '';
+ }
+
function getIndexField() {
return $this->mSort;
}