Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | 'description' => 'Gives editors/reviewers the ability to validate revisions and stabilize pages' |
29 | 29 | ); |
30 | 30 | |
31 | | -$wgExtensionFunctions[] = 'efLoadReviewMessages'; |
| 31 | +$wgExtensionFunctions[] = 'efLoadFlaggedRevs'; |
32 | 32 | |
33 | 33 | # Load promotion UI |
34 | 34 | include_once('SpecialMakevalidate.php'); |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | # Load unreviewed pages list |
40 | 40 | extAddSpecialPage( dirname(__FILE__) . '/FlaggedRevsPage_body.php', 'Unreviewedpages', 'UnreviewedPages' ); |
41 | 41 | |
42 | | -function efLoadReviewMessages() { |
| 42 | +function efLoadFlaggedRevs() { |
43 | 43 | global $wgMessageCache, $RevisionreviewMessages, $wgOut, $wgJsMimeType; |
44 | 44 | # Internationalization |
45 | 45 | require( dirname( __FILE__ ) . '/FlaggedRevsPage.i18n.php' ); |
— | — | @@ -54,12 +54,23 @@ |
55 | 55 | ) ); |
56 | 56 | # UI JS |
57 | 57 | $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"" . FLAGGED_JS . "\"></script>\n" ); |
| 58 | + |
| 59 | + # Use RC Patrolling to check for vandalism |
| 60 | + # When revisions are flagged, they count as patrolled |
| 61 | + $wgUseRCPatrol = true; |
| 62 | + # Use only our extension mechanisms |
| 63 | + $wgGroupPermissions['sysop']['autopatrol'] = false; |
| 64 | + $wgGroupPermissions['sysop']['patrol'] = false; |
58 | 65 | } |
59 | 66 | |
60 | 67 | ######### |
61 | 68 | # IMPORTANT: |
62 | 69 | # When configuring globals, add them to localsettings.php and edit them THERE |
63 | 70 | |
| 71 | +# This will only distinguish "sigted", "quality", and unreviewed |
| 72 | +# A small icon will show in the upper right hand corner |
| 73 | +$wgSimpleFlaggedRevsUI = false; |
| 74 | + |
64 | 75 | # Revision tagging can slow development... |
65 | 76 | # For example, the main user base may become complacent, |
66 | 77 | # perhaps treat flagged pages as "done", |
— | — | @@ -72,6 +83,7 @@ |
73 | 84 | $wgFlaggedRevComments = false; |
74 | 85 | # Make user's watch pages when reviewed if they watch pages that they edit |
75 | 86 | $wgFlaggedRevsWatch = true; |
| 87 | + |
76 | 88 | # How long to cache stable versions? (seconds) |
77 | 89 | $wgFlaggedRevsExpire = 7 * 24 * 3600; |
78 | 90 | |
— | — | @@ -80,7 +92,7 @@ |
81 | 93 | # Define the tags we can use to rate an article, |
82 | 94 | # and set the minimum level to have it become a "quality" version. |
83 | 95 | # "quality" revisions take precidence over other reviewed revisions |
84 | | -$wgFlaggedRevTags = array( 'accuracy'=>2, 'depth'=>2, 'style'=>1 ); |
| 96 | +$wgFlaggedRevTags = array( 'accuracy'=>2, 'depth'=>1, 'style'=>1 ); |
85 | 97 | # How high can we rate these revisions? |
86 | 98 | $wgFlaggedRevValues = 4; |
87 | 99 | # Who can set what flags to what level? (use -1 for not at all) |
— | — | @@ -93,30 +105,20 @@ |
94 | 106 | 'style' => array('review' => 3), |
95 | 107 | ); |
96 | 108 | |
97 | | -# Use RC Patrolling to check for vandalism |
98 | | -# When revisions are flagged, they count as patrolled |
99 | | -$wgUseRCPatrol = true; |
100 | | - |
101 | | -# This will only distinguish "sigted", "quality", and unreviewed |
102 | | -# A small icon will show in the upper right hand corner |
103 | | -$wgSimpleFlaggedRevsUI = false; |
104 | | - |
105 | 109 | # Lets some users access the review UI and set some flags |
106 | 110 | $wgAvailableRights[] = 'review'; |
107 | 111 | # Let some users set higher settings |
108 | 112 | $wgAvailableRights[] = 'validate'; |
109 | 113 | |
110 | 114 | # Define our basic reviewer class |
111 | | -$wgGroupPermissions['editor']['review'] = true; |
112 | | -$wgGroupPermissions['editor']['autopatrol'] = true; |
113 | | -$wgGroupPermissions['editor']['patrol'] = true; |
| 115 | +$wgGroupPermissions['editor']['review'] = true; |
114 | 116 | $wgGroupPermissions['editor']['unwatchedpages'] = true; |
115 | | -$wgGroupPermissions['editor']['autoconfirmed'] = true; |
| 117 | +$wgGroupPermissions['editor']['autoconfirmed'] = true; |
116 | 118 | |
117 | 119 | # Defines extra rights for advanced reviewer class |
118 | | -$wgGroupPermissions['reviewer']['validate'] = true; |
| 120 | +$wgGroupPermissions['reviewer']['validate'] = true; |
119 | 121 | # Let this stand alone just in case... |
120 | | -$wgGroupPermissions['reviewer']['review'] = true; |
| 122 | +$wgGroupPermissions['reviewer']['review'] = true; |
121 | 123 | |
122 | 124 | # Define when users get automatically promoted to editors |
123 | 125 | # Set to false to disable this |
— | — | @@ -1025,7 +1027,7 @@ |
1026 | 1028 | } |
1027 | 1029 | |
1028 | 1030 | function addReviewForm( $out ) { |
1029 | | - global $wgArticle, $action; |
| 1031 | + global $wgArticle, $wgRequest, $action; |
1030 | 1032 | |
1031 | 1033 | if( !$wgArticle || !$wgArticle->exists() || !$wgArticle->mTitle->isContentPage() || $action !='view' ) |
1032 | 1034 | return true; |
— | — | @@ -1034,7 +1036,7 @@ |
1035 | 1037 | return true; |
1036 | 1038 | } |
1037 | 1039 | // Get revision ID |
1038 | | - $revId = ( $wgArticle->mRevision ) ? $wgArticle->mRevision->mId : $wgArticle->getLatest(); |
| 1040 | + $revId = $out->mRevisionId ? $out->mRevisionId : $wgArticle->getLatest(); |
1039 | 1041 | // We cannot review deleted revisions |
1040 | 1042 | if( is_object($wgArticle->mRevision) && $wgArticle->mRevision->mDeleted ) |
1041 | 1043 | return true; |