Use rel="start", "prev", "next" appropriately on Pager-based pages (just adding them...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 7 May 2008 01:47:05 +0000 (01:47 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 7 May 2008 01:47:05 +0000 (01:47 +0000)
RELEASE-NOTES
includes/Pager.php

index 0bba506..69e7b4b 100644 (file)
@@ -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 ===
 
index 85989df..9606860 100644 (file)
@@ -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 {