r99327 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99326‎ | r99327 | r99328 >
Date:23:30, 8 October 2011
Author:aaron
Status:ok
Tags:
Comment:
* Minor code cleanup to defineSpecialPages()
* Doc tweaks
Modified paths:
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.setup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.setup.php
@@ -7,47 +7,47 @@
88 * Register FlaggedRevs special pages as needed.
99 * @param $pages Array $wgSpecialPages (list of special pages)
1010 * @param $groups Array $wgSpecialPageGroups (assoc array of special page groups)
 11+ * @return void
1112 */
1213 public static function defineSpecialPages( array &$pages, array &$groups ) {
1314 global $wgUseTagFilter;
1415 // Show special pages only if FlaggedRevs is enabled on some namespaces
15 - if ( !FlaggedRevs::getReviewNamespaces() ) {
16 - return true;
 16+ if ( FlaggedRevs::getReviewNamespaces() ) {
 17+ $pages['RevisionReview'] = 'RevisionReview'; // unlisted
 18+ $pages['ReviewedVersions'] = 'ReviewedVersions'; // unlisted
 19+ $pages['PendingChanges'] = 'PendingChanges';
 20+ $groups['PendingChanges'] = 'quality';
 21+ // Show tag filtered pending edit page if there are tags
 22+ if ( $wgUseTagFilter ) {
 23+ $pages['ProblemChanges'] = 'ProblemChanges';
 24+ $groups['ProblemChanges'] = 'quality';
 25+ }
 26+ if ( !FlaggedRevs::useOnlyIfProtected() ) {
 27+ $pages['ReviewedPages'] = 'ReviewedPages';
 28+ $groups['ReviewedPages'] = 'quality';
 29+ $pages['UnreviewedPages'] = 'UnreviewedPages';
 30+ $groups['UnreviewedPages'] = 'quality';
 31+ }
 32+ $pages['QualityOversight'] = 'QualityOversight';
 33+ $groups['QualityOversight'] = 'quality';
 34+ $pages['ValidationStatistics'] = 'ValidationStatistics';
 35+ $groups['ValidationStatistics'] = 'quality';
 36+ // Protect levels define allowed stability settings
 37+ if ( FlaggedRevs::useProtectionLevels() ) {
 38+ $pages['StablePages'] = 'StablePages';
 39+ $groups['StablePages'] = 'quality';
 40+ } else {
 41+ $pages['ConfiguredPages'] = 'ConfiguredPages';
 42+ $groups['ConfiguredPages'] = 'quality';
 43+ $pages['Stabilization'] = 'Stabilization'; // unlisted
 44+ }
1745 }
18 - $pages['RevisionReview'] = 'RevisionReview'; // unlisted
19 - $pages['ReviewedVersions'] = 'ReviewedVersions'; // unlisted
20 - $pages['PendingChanges'] = 'PendingChanges';
21 - $groups['PendingChanges'] = 'quality';
22 - // Show tag filtered pending edit page if there are tags
23 - if ( $wgUseTagFilter ) {
24 - $pages['ProblemChanges'] = 'ProblemChanges';
25 - $groups['ProblemChanges'] = 'quality';
26 - }
27 - if ( !FlaggedRevs::useOnlyIfProtected() ) {
28 - $pages['ReviewedPages'] = 'ReviewedPages';
29 - $groups['ReviewedPages'] = 'quality';
30 - $pages['UnreviewedPages'] = 'UnreviewedPages';
31 - $groups['UnreviewedPages'] = 'quality';
32 - }
33 - $pages['QualityOversight'] = 'QualityOversight';
34 - $groups['QualityOversight'] = 'quality';
35 - $pages['ValidationStatistics'] = 'ValidationStatistics';
36 - $groups['ValidationStatistics'] = 'quality';
37 - // Protect levels define allowed stability settings
38 - if ( FlaggedRevs::useProtectionLevels() ) {
39 - $pages['StablePages'] = 'StablePages';
40 - $groups['StablePages'] = 'quality';
41 - } else {
42 - $pages['ConfiguredPages'] = 'ConfiguredPages';
43 - $groups['ConfiguredPages'] = 'quality';
44 - $pages['Stabilization'] = 'Stabilization'; // unlisted
45 - }
46 - return true;
4746 }
4847
4948 /**
5049 * Append FlaggedRevs resource module definitions
51 - * @param $modules Array $wgResourceModules
 50+ * @param $modules Array $wgResourceModules (list of modules)
 51+ * @return void
5252 */
5353 public static function defineResourceModules( &$modules ) {
5454 $localModulePath = dirname( __FILE__ ) . '/modules/';
@@ -90,8 +90,8 @@
9191
9292 /**
9393 * Append FlaggedRevs log names and set filterable logs
94 - * @param $logNames Array $wgLogNames
95 - * @param $logHeaders Array $wgLogHeaders
 94+ * @param $logNames Array $wgLogNames (assoc array of log name message keys)
 95+ * @param $logHeaders Array $wgLogHeaders (assoc array of log header message keys)
9696 * @param $filterLogTypes Array $wgFilterLogTypes
9797 */
9898 public static function defineLogBasicDescription( &$logNames, &$logHeaders, &$filterLogTypes ) {
@@ -106,8 +106,9 @@
107107
108108 /**
109109 * Append FlaggedRevs log action handlers
110 - * @param $logActions Array $wgLogActions
111 - * @param $logActionsHandlers Array $wgLogActionsHandlers
 110+ * @param $logActions Array $wgLogActions (assoc array of log action message keys)
 111+ * @param $logActionsHandlers Array $wgLogActionsHandlers (assoc array of log handlers)
 112+ * @return void
112113 */
113114 public static function defineLogActionHanders( &$logActions, &$logActionsHandlers ) {
114115 # Various actions are used for log filtering ...

Status & tagging log