* (bug 20318) Distinct CSS classes for ISBN/RFC/PMID special links added
authorRaimond Spekking <raymond@users.mediawiki.org>
Thu, 20 Aug 2009 09:13:29 +0000 (09:13 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Thu, 20 Aug 2009 09:13:29 +0000 (09:13 +0000)
RELEASE-NOTES
includes/parser/Parser.php

index a80c4bf..138d626 100644 (file)
@@ -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 ===
 
index d5e329e..ec9ff0d 100644 (file)
@@ -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 "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
                } elseif ( isset( $m[5] ) && $m[5] !== '' ) {
                        # ISBN
@@ -972,7 +975,7 @@ class Parser
                        $titleObj = SpecialPage::getTitleFor( 'Booksources', $num );
                        return'<a href="' .
                                $titleObj->escapeLocalUrl() .
-                               "\" class=\"internal\">ISBN $isbn</a>";
+                               "\" class=\"internal mw-magiclink-isbn\">ISBN $isbn</a>";
                } else {
                        return $m[0];
                }