Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php |
— | — | @@ -3,6 +3,13 @@ |
4 | 4 | class WikiArticleFeeds{ |
5 | 5 | |
6 | 6 | function feedStart( $text, $params = array() ) { |
| 7 | + global $wgParser, $wgWikiArticleFeedsTrackingCategory; |
| 8 | + |
| 9 | + if ( $wgWikiArticleFeedsTrackingCategory === true ) { |
| 10 | + $wgParser->addTrackingCategory( 'wikiarticlefeeds-tracking-category' ); |
| 11 | + } elseif ( is_string( $wgWikiArticleFeedsTrackingCategory ) ) { |
| 12 | + $wgParser->addTrackingCategory( $wgWikiArticleFeedsTrackingCategory ); |
| 13 | + } |
7 | 14 | return '<!-- FEED_START -->'; |
8 | 15 | } |
9 | 16 | |
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.i18n.php |
— | — | @@ -10,6 +10,7 @@ |
11 | 11 | |
12 | 12 | $messages['en'] = array( |
13 | 13 | 'wikiarticlefeeds-desc' => 'Produces feeds generated from MediaWiki pages', |
| 14 | + 'wikiarticlefeeds-tracking-category' => 'RSS authoring page', |
14 | 15 | 'wikiarticlefeeds_combined_description' => 'This is a combined feed, containing items from several feed sources.', |
15 | 16 | ); |
16 | 17 | |
— | — | @@ -19,6 +20,7 @@ |
20 | 21 | */ |
21 | 22 | $messages['qqq'] = array( |
22 | 23 | 'wikiarticlefeeds-desc' => '{{desc}}', |
| 24 | + 'wikiarticlefeeds-tracking-category' => 'The name of a category for all pages which use the WikiArticleFeeds parser extension. The category is automatically added unless the feature is disabled.', |
23 | 25 | ); |
24 | 26 | |
25 | 27 | /** Afrikaans (Afrikaans) |
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php |
— | — | @@ -157,3 +157,16 @@ |
158 | 158 | |
159 | 159 | $wgWikiArticleFeeds = new WikiArticleFeeds(); |
160 | 160 | $wgHooks['ParserBeforeTidy'][] = array( $wgWikiArticleFeeds, 'WikiArticleFeeds::itemTagsPlaceholderCorrections' ); |
| 161 | + |
| 162 | +// Parameter to enable the automatic tracking category |
| 163 | +// for all pages using this parser extension |
| 164 | +// |
| 165 | +// Category name [[MediaWiki:Wikiarticlefeeds-tracking-category]] (default) |
| 166 | +// $wgWikiArticleFeedsTrackingCategory = true; |
| 167 | +// |
| 168 | +// you can assign a specific category name [[MediaWiki:Wikiarticlefeeds-mycategory]] |
| 169 | +// $wgWikiArticleFeedsTrackingCategory = 'wikiarticlefeeds-mycategory'; |
| 170 | +// |
| 171 | +// you can disable the use of a tracking category |
| 172 | +// $wgWikiArticleFeedsTrackingCategory = false; |
| 173 | +$wgWikiArticleFeedsTrackingCategory = true; |