$keyword = 'RFC';
$urlmsg = 'rfcurl';
$cssClass = 'mw-magiclink-rfc';
+ $trackingCat = 'magiclink-tracking-rfc';
$id = $m[5];
} elseif ( substr( $m[0], 0, 4 ) === 'PMID' ) {
if ( !$this->mOptions->getMagicPMIDLinks() ) {
$keyword = 'PMID';
$urlmsg = 'pubmedurl';
$cssClass = 'mw-magiclink-pmid';
+ $trackingCat = 'magiclink-tracking-pmid';
$id = $m[5];
} else {
throw new MWException( __METHOD__ . ': unrecognised match type "' .
substr( $m[0], 0, 20 ) . '"' );
}
$url = wfMessage( $urlmsg, $id )->inContentLanguage()->text();
+ $this->addTrackingCategory( $trackingCat );
return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $cssClass, [], $this->mTitle );
} elseif ( isset( $m[6] ) && $m[6] !== ''
&& $this->mOptions->getMagicISBNLinks()
' ' => '',
'x' => 'X',
] );
+ $this->addTrackingCategory( 'magiclink-tracking-isbn' );
return $this->getLinkRenderer()->makeKnownLink(
SpecialPage::getTitleFor( 'Booksources', $num ),
"ISBN $isbn",
ExtensionRegistry::getInstance()->getAttribute( 'TrackingCategories' ),
$this->getConfig()->get( 'TrackingCategories' ) // deprecated
);
+
+ // Only show magic link tracking categories if they are enabled
+ $enableMagicLinks = $this->getConfig()->get( 'EnableMagicLinks' );
+ if ( $enableMagicLinks['ISBN'] ) {
+ $categories[] = 'magiclink-tracking-isbn';
+ }
+ if ( $enableMagicLinks['RFC'] ) {
+ $categories[] = 'magiclink-tracking-rfc';
+ }
+ if ( $enableMagicLinks['PMID'] ) {
+ $categories[] = 'magiclink-tracking-pmid';
+ }
+
$trackingCategories = [];
foreach ( $categories as $catMsg ) {
/*
"booksources-search": "Search",
"booksources-text": "Below is a list of links to other sites that sell new and used books, and may also have further information about books you are looking for:",
"booksources-invalid-isbn": "The given ISBN does not appear to be valid; check for errors copying from the original source.",
+ "magiclink-tracking-rfc": "Pages using RFC magic links",
+ "magiclink-tracking-rfc-desc": "This page uses RFC magic links. See [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org] on how to migrate.",
+ "magiclink-tracking-pmid": "Pages using PMID magic links",
+ "magiclink-tracking-pmid-desc": "This page uses PMID magic links. See [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org] on how to migrate.",
+ "magiclink-tracking-isbn": "Pages using ISBN magic links",
+ "magiclink-tracking-isbn-desc": "This page uses ISBN magic links. See [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org] on how to migrate.",
"rfcurl": "//tools.ietf.org/html/rfc$1",
"pubmedurl": "//www.ncbi.nlm.nih.gov/pubmed/$1?dopt=Abstract",
"specialloguserlabel": "Performer:",
"booksources-search": "Search button in [[Special:BookSources]]\n\n{{Identical|Search}}",
"booksources-text": "Used in [[Special:BookSources/1]].\n\nThis message is followed by a list of links to other sites.\n\nSee also:\n* {{msg-mw|Booksources|title}}\n* {{msg-mw|Booksources-text|text}}",
"booksources-invalid-isbn": "This message is displayed after an invalid ISBN is entered on [[Special:Booksources]].",
+ "magiclink-tracking-rfc": "Name of the [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]] where pages that use RFC magic links will be added.",
+ "magiclink-tracking-rfc-desc": "Description of the tracking category {{mw-msg|magiclink-tracking-rfc}}",
+ "magiclink-tracking-pmid": "Name of the [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]] where pages that use PMID magic links will be added.",
+ "magiclink-tracking-pmid-desc": "Description of the tracking category {{mw-msg|magiclink-tracking-pmid}}",
+ "magiclink-tracking-isbn": "Name of the [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]] where pages that use ISBN magic links will be added.",
+ "magiclink-tracking-isbn-desc": "Description of the tracking category {{mw-msg|magiclink-tracking-isbn}}",
"rfcurl": "{{notranslate}}\nParameters:\n* $1 - RFC number\nSee also:\n* {{msg-mw|Pubmedurl}}",
"pubmedurl": "{{notranslate}}\nParameters:\n* $1 - Pubmed number\nSee also:\n* {{msg-mw|Rfcurl}}",
"specialloguserlabel": "Used in [[Special:Log]] as a label for an input field with which the log can be filtered for entries describing actions ''performed'' by the specified user. \"Carried out\" and \"done\" are possible alternatives for \"performed\".",