From e1e2c80783caacfb573749c371e1d90aa88cad1f Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Thu, 20 Aug 2009 09:13:29 +0000 Subject: [PATCH] * (bug 20318) Distinct CSS classes for ISBN/RFC/PMID special links added --- RELEASE-NOTES | 1 + includes/parser/Parser.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a80c4bf2aa..138d626ef7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -199,6 +199,7 @@ this. Was used when mwEmbed was going to be an extension. * New hook SpecialRandomGetRandomTitle allows extensions to modify the selection criteria used by Special:Random and subclasses, or substitute a custom result, deprecating the $wgExtraRandompageSQL config variable +* (bug 20318) Distinct CSS classes for ISBN/RFC/PMID special links added === Bug fixes in 1.16 === diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index d5e329eee1..ec9ff0d28a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -945,13 +945,16 @@ class Parser return $this->makeFreeExternalLink( $m[0] ); } elseif ( isset( $m[4] ) && $m[4] !== '' ) { # RFC or PMID + $CssClass = ''; if ( substr( $m[0], 0, 3 ) === 'RFC' ) { $keyword = 'RFC'; $urlmsg = 'rfcurl'; + $CssClass = 'mw-magiclink-rfc'; $id = $m[4]; } elseif ( substr( $m[0], 0, 4 ) === 'PMID' ) { $keyword = 'PMID'; $urlmsg = 'pubmedurl'; + $CssClass = 'mw-magiclink-pmid'; $id = $m[4]; } else { throw new MWException( __METHOD__.': unrecognised match type "' . @@ -959,7 +962,7 @@ class Parser } $url = wfMsg( $urlmsg, $id); $sk = $this->mOptions->getSkin(); - $la = $sk->getExternalLinkAttributes(); + $la = $sk->getExternalLinkAttributes( "external $CssClass" ); return "{$keyword} {$id}"; } elseif ( isset( $m[5] ) && $m[5] !== '' ) { # ISBN @@ -972,7 +975,7 @@ class Parser $titleObj = SpecialPage::getTitleFor( 'Booksources', $num ); return'ISBN $isbn"; + "\" class=\"internal mw-magiclink-isbn\">ISBN $isbn"; } else { return $m[0]; } -- 2.20.1