64 $categories = array_merge(
65 self::$coreTrackingCategories,
67 $this->config->get(
'TrackingCategories' )
71 $enableMagicLinks = $this->config->get(
'EnableMagicLinks' );
72 if ( $enableMagicLinks[
'ISBN'] ) {
73 $categories[] =
'magiclink-tracking-isbn';
75 if ( $enableMagicLinks[
'RFC'] ) {
76 $categories[] =
'magiclink-tracking-rfc';
78 if ( $enableMagicLinks[
'PMID'] ) {
79 $categories[] =
'magiclink-tracking-pmid';
82 $trackingCategories = [];
83 foreach ( $categories as $catMsg ) {
89 $msgObj =
wfMessage( $catMsg )->inContentLanguage();
91 $catMsgTitle = Title::makeTitleSafe( NS_MEDIAWIKI, $catMsg );
92 if ( !$catMsgTitle ) {
98 if ( strpos( $msgObj->plain(),
'{{' ) !==
false ) {
99 $ns = MWNamespace::getValidNamespaces();
100 foreach ( $ns as $namesp ) {
101 $tempTitle = Title::makeTitleSafe( $namesp, $catMsg );
105 $catName = $msgObj->title( $tempTitle )->text();
106 # Allow tracking categories to be disabled by setting them to "-"
107 if ( $catName !==
'-' ) {
108 $catTitle = Title::makeTitleSafe(
NS_CATEGORY, $catName );
110 $allCats[] = $catTitle;
115 $catName = $msgObj->text();
116 # Allow tracking categories to be disabled by setting them to "-"
117 if ( $catName !==
'-' ) {
118 $catTitle = Title::makeTitleSafe(
NS_CATEGORY, $catName );
120 $allCats[] = $catTitle;
124 $trackingCategories[$catMsg] = [
126 'msg' => $catMsgTitle,
130 return $trackingCategories;