Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -48,10 +48,7 @@ |
49 | 49 | $wgExtensionAliasesFiles |
50 | 50 | ); |
51 | 51 | |
52 | | -# Load hooks that are always set |
53 | | -FlaggedRevsSetup::setUnconditionalHooks(); |
54 | | - |
55 | | -# Define new rights that FlaggedRevs creates |
| 52 | +# Define user rights |
56 | 53 | $wgAvailableRights[] = 'review'; # review pages to basic quality levels |
57 | 54 | $wgAvailableRights[] = 'validate'; # review pages to all quality levels |
58 | 55 | $wgAvailableRights[] = 'autoreview'; # auto-review one's own edits (including rollback) |
— | — | @@ -64,10 +61,7 @@ |
65 | 62 | # array so that it shows up in sp:ListGroupRights... |
66 | 63 | $wgGroupPermissions['bot']['autoreview'] = true; |
67 | 64 | |
68 | | -# Special case cache invalidations |
69 | | -$wgJobClasses['flaggedrevs_CacheUpdate'] = 'FRExtraCacheUpdateJob'; |
70 | | - |
71 | | -# New user preferences |
| 65 | +# Define user preferences |
72 | 66 | $wgDefaultUserOptions['flaggedrevssimpleui'] = (int)$wgSimpleFlaggedRevsUI; |
73 | 67 | $wgDefaultUserOptions['flaggedrevsstable'] = FR_SHOW_STABLE_DEFAULT; |
74 | 68 | $wgDefaultUserOptions['flaggedrevseditdiffs'] = true; |
— | — | @@ -88,6 +82,12 @@ |
89 | 83 | # AJAX functions |
90 | 84 | FlaggedRevsUISetup::defineAjaxFunctions( $wgAjaxExportList ); |
91 | 85 | |
| 86 | +# Special case page cache invalidations |
| 87 | +$wgJobClasses['flaggedrevs_CacheUpdate'] = 'FRExtraCacheUpdateJob'; |
| 88 | + |
| 89 | +# Load hooks that are always set |
| 90 | +FlaggedRevsSetup::setUnconditionalHooks(); |
| 91 | + |
92 | 92 | # Load the extension after setup is finished |
93 | 93 | $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; |
94 | 94 | |
— | — | @@ -95,6 +95,7 @@ |
96 | 96 | * This function is for setup that has to happen in Setup.php |
97 | 97 | * when the functions in $wgExtensionFunctions get executed. |
98 | 98 | * Note: avoid calls to FlaggedRevs class here for performance. |
| 99 | + * @return void |
99 | 100 | */ |
100 | 101 | function efLoadFlaggedRevs() { |
101 | 102 | # LocalSettings.php loaded, safe to load config |
— | — | @@ -114,6 +115,3 @@ |
115 | 116 | # Defaults for user preferences |
116 | 117 | FlaggedRevsSetup::setConditionalPreferences(); |
117 | 118 | } |
118 | | - |
119 | | -# B/C ... |
120 | | -$wgLogActions['rights/erevoke'] = 'rights-editor-revoke'; |
Index: trunk/extensions/FlaggedRevs/frontend/FlaggedRevsUI.setup.php |
— | — | @@ -227,6 +227,9 @@ |
228 | 228 | $logActions['review/unapprove'] = 'review-logentry-dis'; // was checked |
229 | 229 | $logActions['review/unapprove2'] = 'review-logentry-dis'; // was quality |
230 | 230 | |
| 231 | + # B/C ... |
| 232 | + $logActions['rights/erevoke'] = 'rights-editor-revoke'; |
| 233 | + |
231 | 234 | $logActionsHandlers['stable/config'] = 'FlaggedRevsLogView::stabilityLogText'; // customize |
232 | 235 | $logActionsHandlers['stable/modify'] = 'FlaggedRevsLogView::stabilityLogText'; // re-customize |
233 | 236 | $logActionsHandlers['stable/reset'] = 'FlaggedRevsLogView::stabilityLogText'; // reset |
Index: trunk/extensions/FlaggedRevs/backend/FlaggedRevs.hooks.php |
— | — | @@ -359,7 +359,7 @@ |
360 | 360 | ) { |
361 | 361 | global $wgRequest; |
362 | 362 | # Edit must be non-null, to a reviewable page, with $user set |
363 | | - $fa = FlaggableWikiPage::getArticleInstance( $article ); |
| 363 | + $fa = FlaggableWikiPage::getTitleInstance( $article->getTitle() ); |
364 | 364 | $fa->loadPageData( 'fromdbmaster' ); |
365 | 365 | if ( !$rev || !$user || !$fa->isReviewable() ) { |
366 | 366 | return true; |
— | — | @@ -540,7 +540,7 @@ |
541 | 541 | if ( !$baseId && !$reviewEdit ) { |
542 | 542 | return true; // short-circuit |
543 | 543 | } |
544 | | - $fa = FlaggableWikiPage::getArticleInstance( $article ); |
| 544 | + $fa = FlaggableWikiPage::getTitleInstance( $article->getTitle() ); |
545 | 545 | $fa->loadPageData( 'fromdbmaster' ); |
546 | 546 | if ( !$fa->isReviewable() ) { |
547 | 547 | return true; // page is not reviewable |
Index: trunk/extensions/FlaggedRevs/backend/FlaggableWikiPage.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Get a FlaggableWikiPage for a given title |
21 | | - * @param Title |
| 21 | + * @param $title Title |
22 | 22 | * @return FlaggableWikiPage |
23 | 23 | */ |
24 | 24 | public static function getTitleInstance( Title $title ) { |
— | — | @@ -29,15 +29,6 @@ |
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | | - * Get a FlaggableWikiPage for a given article |
34 | | - * @param Article |
35 | | - * @return FlaggableWikiPage |
36 | | - */ |
37 | | - public static function getArticleInstance( Page $article ) { |
38 | | - return self::getTitleInstance( $article->getTitle() ); |
39 | | - } |
40 | | - |
41 | | - /** |
42 | 33 | * Clear object process cache values |
43 | 34 | * @return void |
44 | 35 | */ |
— | — | @@ -54,7 +45,6 @@ |
55 | 46 | |
56 | 47 | /** |
57 | 48 | * Get the current file version (null if this not a File page) |
58 | | - * |
59 | 49 | * @return File|null|false |
60 | 50 | */ |
61 | 51 | public function getFile() { |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php |
— | — | @@ -5,20 +5,21 @@ |
6 | 6 | * Note: avoid FlaggedRevs class calls here for performance (like load.php). |
7 | 7 | */ |
8 | 8 | class FlaggedRevsSetup { |
| 9 | + /* Variable checked by FlaggedRevs::load() */ |
9 | 10 | protected static $canLoad = false; |
10 | 11 | |
11 | 12 | /** |
12 | 13 | * Signal that LocalSettings.php is loaded. |
13 | | - |
| 14 | + * |
14 | 15 | * @return void |
15 | 16 | */ |
16 | 17 | public static function setReady() { |
17 | 18 | self::$canLoad = true; |
18 | 19 | } |
19 | 20 | |
20 | | - /* |
| 21 | + /** |
21 | 22 | * The FlaggedRevs class uses this as a sanity check. |
22 | | - |
| 23 | + * |
23 | 24 | * @return bool |
24 | 25 | */ |
25 | 26 | public static function isReady() { |