From 8d69540a2fc52093b9380976f732f886c42e0afc Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 7 May 2008 01:47:05 +0000 Subject: [PATCH] Use rel="start", "prev", "next" appropriately on Pager-based pages (just adding them to the tags, not adding at the moment). I don't think any client uses these right now, but then, of course they won't if no web apps use them, will they? --- RELEASE-NOTES | 1 + includes/Pager.php | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0bba506169..69e7b4b2dd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -104,6 +104,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13950) Allow users to watch the user/talk pages of users they block. * (bug 13970) Allow MonoBook-based skins to specify their own print stylesheet * Show image links on Special:Whatlinkshere +* Use rel="start", "prev", "next" appropriately on Pager-based pages === Bug fixes in 1.13 === diff --git a/includes/Pager.php b/includes/Pager.php index 85989dffb1..9606860e3c 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -273,12 +273,21 @@ abstract class IndexPager implements Pager { /** * Make a self-link */ - function makeLink($text, $query = null) { + function makeLink($text, $query = null, $type=null) { 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 = ''; + } return $this->getSkin()->makeKnownLinkObj( $this->getTitle(), $text, - wfArrayToCGI( $query, $this->getDefaultQuery() ) ); + wfArrayToCGI( $query, $this->getDefaultQuery() ), '', '', + $attrs ); } /** @@ -389,7 +398,7 @@ abstract class IndexPager implements Pager { $links = array(); foreach ( $queries as $type => $query ) { if ( $query !== false ) { - $links[$type] = $this->makeLink( $linkTexts[$type], $queries[$type] ); + $links[$type] = $this->makeLink( $linkTexts[$type], $queries[$type], $type ); } elseif ( isset( $disabledTexts[$type] ) ) { $links[$type] = $disabledTexts[$type]; } else { -- 2.20.1