r55368 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55367‎ | r55368 | r55369 >
Date:09:13, 20 August 2009
Author:raymond
Status:resolved
Tags:
Comment:
* (bug 20318) Distinct CSS classes for ISBN/RFC/PMID special links added
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -945,13 +945,16 @@
946946 return $this->makeFreeExternalLink( $m[0] );
947947 } elseif ( isset( $m[4] ) && $m[4] !== '' ) {
948948 # RFC or PMID
 949+ $CssClass = '';
949950 if ( substr( $m[0], 0, 3 ) === 'RFC' ) {
950951 $keyword = 'RFC';
951952 $urlmsg = 'rfcurl';
 953+ $CssClass = 'mw-magiclink-rfc';
952954 $id = $m[4];
953955 } elseif ( substr( $m[0], 0, 4 ) === 'PMID' ) {
954956 $keyword = 'PMID';
955957 $urlmsg = 'pubmedurl';
 958+ $CssClass = 'mw-magiclink-pmid';
956959 $id = $m[4];
957960 } else {
958961 throw new MWException( __METHOD__.': unrecognised match type "' .
@@ -959,7 +962,7 @@
960963 }
961964 $url = wfMsg( $urlmsg, $id);
962965 $sk = $this->mOptions->getSkin();
963 - $la = $sk->getExternalLinkAttributes();
 966+ $la = $sk->getExternalLinkAttributes( "external $CssClass" );
964967 return "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
965968 } elseif ( isset( $m[5] ) && $m[5] !== '' ) {
966969 # ISBN
@@ -972,7 +975,7 @@
973976 $titleObj = SpecialPage::getTitleFor( 'Booksources', $num );
974977 return'<a href="' .
975978 $titleObj->escapeLocalUrl() .
976 - "\" class=\"internal\">ISBN $isbn</a>";
 979+ "\" class=\"internal mw-magiclink-isbn\">ISBN $isbn</a>";
977980 } else {
978981 return $m[0];
979982 }
Index: trunk/phase3/RELEASE-NOTES
@@ -199,6 +199,7 @@
200200 * New hook SpecialRandomGetRandomTitle allows extensions to modify the selection
201201 criteria used by Special:Random and subclasses, or substitute a custom result,
202202 deprecating the $wgExtraRandompageSQL config variable
 203+* (bug 20318) Distinct CSS classes for ISBN/RFC/PMID special links added
203204
204205 === Bug fixes in 1.16 ===
205206

Follow-up revisions

RevisionCommit summaryAuthorDate
r55380Follow-up r55368: Fix parser testsraymond13:41, 20 August 2009

Status & tagging log