68 $categories = array_merge(
69 self::$coreTrackingCategories,
70 ExtensionRegistry::getInstance()->getAttribute(
'TrackingCategories' ),
71 $this->config->get(
'TrackingCategories' )
75 $enableMagicLinks = $this->config->get(
'EnableMagicLinks' );
76 if ( $enableMagicLinks[
'ISBN'] ) {
77 $categories[] =
'magiclink-tracking-isbn';
79 if ( $enableMagicLinks[
'RFC'] ) {
80 $categories[] =
'magiclink-tracking-rfc';
82 if ( $enableMagicLinks[
'PMID'] ) {
83 $categories[] =
'magiclink-tracking-pmid';
86 $trackingCategories = [];
87 $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
88 foreach ( $categories as $catMsg ) {
94 $msgObj =
wfMessage( $catMsg )->inContentLanguage();
96 $catMsgTitle = Title::makeTitleSafe(
NS_MEDIAWIKI, $catMsg );
97 if ( !$catMsgTitle ) {
103 if ( strpos( $msgObj->plain(),
'{{' ) !==
false ) {
104 $ns = $nsInfo->getValidNamespaces();
105 foreach ( $ns as $namesp ) {
106 $tempTitle = Title::makeTitleSafe( $namesp, $catMsg );
110 $catName = $msgObj->page( $tempTitle )->text();
111 # Allow tracking categories to be disabled by setting them to "-"
112 if ( $catName !==
'-' ) {
113 $catTitle = Title::makeTitleSafe(
NS_CATEGORY, $catName );
115 $allCats[] = $catTitle;
120 $catName = $msgObj->text();
121 # Allow tracking categories to be disabled by setting them to "-"
122 if ( $catName !==
'-' ) {
123 $catTitle = Title::makeTitleSafe(
NS_CATEGORY, $catName );
125 $allCats[] = $catTitle;
129 $trackingCategories[$catMsg] = [
131 'msg' => $catMsgTitle,
135 return $trackingCategories;