63 $categories = array_merge(
64 self::$coreTrackingCategories,
66 $this->config->get(
'TrackingCategories' )
70 $enableMagicLinks = $this->config->get(
'EnableMagicLinks' );
71 if ( $enableMagicLinks[
'ISBN'] ) {
72 $categories[] =
'magiclink-tracking-isbn';
74 if ( $enableMagicLinks[
'RFC'] ) {
75 $categories[] =
'magiclink-tracking-rfc';
77 if ( $enableMagicLinks[
'PMID'] ) {
78 $categories[] =
'magiclink-tracking-pmid';
81 $trackingCategories = [];
82 foreach ( $categories
as $catMsg ) {
88 $msgObj =
wfMessage( $catMsg )->inContentLanguage();
90 $catMsgTitle = Title::makeTitleSafe(
NS_MEDIAWIKI, $catMsg );
91 if ( !$catMsgTitle ) {
97 if ( strpos( $msgObj->plain(),
'{{' ) !==
false ) {
98 $ns = MWNamespace::getValidNamespaces();
99 foreach ( $ns
as $namesp ) {
100 $tempTitle = Title::makeTitleSafe( $namesp, $catMsg );
104 $catName = $msgObj->title( $tempTitle )->text();
105 # Allow tracking categories to be disabled by setting them to "-"
106 if ( $catName !==
'-' ) {
107 $catTitle = Title::makeTitleSafe(
NS_CATEGORY, $catName );
109 $allCats[] = $catTitle;
114 $catName = $msgObj->text();
115 # Allow tracking categories to be disabled by setting them to "-"
116 if ( $catName !==
'-' ) {
117 $catTitle = Title::makeTitleSafe(
NS_CATEGORY, $catName );
119 $allCats[] = $catTitle;
123 $trackingCategories[$catMsg] = [
125 'msg' => $catMsgTitle,
129 return $trackingCategories;