From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- includes/Pager.php | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'includes/Pager.php') 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 = "\n"; + $rowClass = $this->getRowClass( $row ); + $s = "\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; } -- cgit v1.2.2