From 4299d279567b58af085287d8c4b7a99e0ab1ce3d Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 22 Jan 2009 00:11:23 +0000 Subject: [PATCH] Use HTML5 rel attributes for some links http://dev.w3.org/html5/spec/#linkTypes Probably doesn't do much, but looks cool. :) --- RELEASE-NOTES | 1 + includes/Pager.php | 18 ++++++++---------- includes/Skin.php | 4 ++-- includes/SkinTemplate.php | 3 ++- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f64b70834c..0f010615a0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -51,6 +51,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11644) Add $wgMaxRedirects variable to control how many redirects are recursed through until the "destination" page is reached. * Add $wgInvalidRedirectTargets variable to prevent redirects to certain special pages. +* Use HTML5 rel attributes for some links, where appropriate === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/Pager.php b/includes/Pager.php index 8ec32ff491..22cac2748e 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(), 'known' ); } /** diff --git a/includes/Skin.php b/includes/Skin.php index 3edcd92efe..9d7584bb76 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1566,8 +1566,8 @@ END; function historyLink() { global $wgTitle; - return $this->makeKnownLinkObj( $wgTitle, - wfMsg( 'history' ), 'action=history' ); + return $this->link( $wgTitle, wfMsg( 'history' ), + array( 'rel' => 'archives' ), array( 'action' => 'history' ) ); } function whatLinksHere() { diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index b7743925f0..1785fa0f00 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -710,7 +710,8 @@ class SkinTemplate extends Skin { $content_actions['history'] = array( 'class' => ($action == 'history') ? 'selected' : false, 'text' => wfMsg('history_short'), - 'href' => $this->mTitle->getLocalUrl( 'action=history') + 'href' => $this->mTitle->getLocalUrl( 'action=history' ), + 'rel' => 'archives', ); if( $wgUser->isAllowed('delete') ) { -- 2.20.1