r46876 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46875‎ | r46876 | r46877 >
Date:22:46, 5 February 2009
Author:danny_b
Status:deferred (Comments)
Tags:
Comment:
* adding rel="alternate" to links pointing to printable version or feed
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -296,7 +296,7 @@
297297 if($this->data['feeds']) { ?>
298298 <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
299299 ?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php
300 - echo htmlspecialchars($feed['href']) ?>" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;
 300+ echo htmlspecialchars($feed['href']) ?>" rel="alternate" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;
301301 <?php } ?></li><?php
302302 }
303303
@@ -310,7 +310,7 @@
311311
312312 if(!empty($this->data['nav_urls']['print']['href'])) { ?>
313313 <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
314 - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php
 314+ ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php
315315 }
316316
317317 if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
Index: trunk/phase3/skins/Modern.php
@@ -294,7 +294,7 @@
295295 if($this->data['feeds']) { ?>
296296 <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
297297 ?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php
298 - echo htmlspecialchars($feed['href']) ?>" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;
 298+ echo htmlspecialchars($feed['href']) ?>" rel="alternate" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;
299299 <?php } ?></li><?php
300300 }
301301
@@ -308,7 +308,7 @@
309309
310310 if(!empty($this->data['nav_urls']['print']['href'])) { ?>
311311 <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
312 - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php
 312+ ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php
313313 }
314314
315315 if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
Index: trunk/phase3/includes/Skin.php
@@ -1001,11 +1001,11 @@
10021002
10031003 $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
10041004
1005 - $s = "<a href=\"$printurl\">" . wfMsg( 'printableversion' ) . '</a>';
 1005+ $s = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
10061006 if( $wgOut->isSyndicated() ) {
10071007 foreach( $wgFeedClasses as $format => $class ) {
10081008 $feedurl = $wgRequest->escapeAppendQuery( "feed=$format" );
1009 - $s .= " | <a href=\"$feedurl\" class=\"feedlink\">{$format}</a>";
 1009+ $s .= " | <a href=\"$feedurl\" rel=\"alternate\" class=\"feedlink\">{$format}</a>";
10101010 }
10111011 }
10121012 return $s;

Comments

#Comment by Werdna (talk | contribs)   22:56, 5 February 2009

+ ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a><?php Missing space?

#Comment by Danny B. (talk | contribs)   23:48, 5 February 2009

Nope. It's being generated by $this->skin->tooltipAndAccesskey() as in previous versions (compare).

Status & tagging log