Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -379,6 +379,7 @@ |
380 | 380 | $wgAutoloadClasses['ValidationStatistics'] = $dir . 'specialpages/ValidationStatistics_body.php'; |
381 | 381 | $wgExtensionMessagesFiles['ValidationStatistics'] = $langDir . 'ValidationStatistics.i18n.php'; |
382 | 382 | $wgSpecialPageGroups['ValidationStatistics'] = 'quality'; |
| 383 | + |
383 | 384 | # API Modules |
384 | 385 | $wgAutoloadClasses['FlaggedRevsApiHooks'] = $dir . 'api/FlaggedRevsApi.hooks.php'; |
385 | 386 | # OldReviewedPages for API |
— | — | @@ -386,10 +387,8 @@ |
387 | 388 | $wgAPIListModules['oldreviewedpages'] = 'ApiQueryOldreviewedpages'; |
388 | 389 | # UnreviewedPages for API |
389 | 390 | $wgAutoloadClasses['ApiQueryUnreviewedpages'] = $dir . 'api/ApiQueryUnreviewedpages.php'; |
390 | | -$wgAPIListModules['unreviewedpages'] = 'ApiQueryUnreviewedpages'; |
391 | 391 | # ReviewedPages for API |
392 | 392 | $wgAutoloadClasses['ApiQueryReviewedpages'] = $dir . 'api/ApiQueryReviewedpages.php'; |
393 | | -$wgAPIListModules['reviewedpages'] = 'ApiQueryReviewedpages'; |
394 | 393 | # Flag metadata for pages for API |
395 | 394 | $wgAutoloadClasses['ApiQueryFlagged'] = $dir . 'api/ApiQueryFlagged.php'; |
396 | 395 | $wgAPIPropModules['flagged'] = 'ApiQueryFlagged'; |
— | — | @@ -561,6 +560,12 @@ |
562 | 561 | # Don't show autoreview group everywhere |
563 | 562 | global $wgImplicitGroups; |
564 | 563 | $wgImplicitGroups[] = 'autoreview'; |
| 564 | + # Conditional API modules |
| 565 | + global $wgAPIListModules; |
| 566 | + if ( !FlaggedRevs::stableOnlyIfConfigured() ) { |
| 567 | + $wgAPIListModules['reviewedpages'] = 'ApiQueryReviewedpages'; |
| 568 | + $wgAPIListModules['unreviewedpages'] = 'ApiQueryUnreviewedpages'; |
| 569 | + } |
565 | 570 | } |
566 | 571 | |
567 | 572 | # Add review log |