r24773 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24772‎ | r24773 | r24774 >
Date:07:49, 14 August 2007
Author:aaron
Status:old
Tags:
Comment:
*Fix error with wrong rev id for diffs
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -27,7 +27,7 @@
2828 'description' => 'Gives editors/reviewers the ability to validate revisions and stabilize pages'
2929 );
3030
31 -$wgExtensionFunctions[] = 'efLoadReviewMessages';
 31+$wgExtensionFunctions[] = 'efLoadFlaggedRevs';
3232
3333 # Load promotion UI
3434 include_once('SpecialMakevalidate.php');
@@ -38,7 +38,7 @@
3939 # Load unreviewed pages list
4040 extAddSpecialPage( dirname(__FILE__) . '/FlaggedRevsPage_body.php', 'Unreviewedpages', 'UnreviewedPages' );
4141
42 -function efLoadReviewMessages() {
 42+function efLoadFlaggedRevs() {
4343 global $wgMessageCache, $RevisionreviewMessages, $wgOut, $wgJsMimeType;
4444 # Internationalization
4545 require( dirname( __FILE__ ) . '/FlaggedRevsPage.i18n.php' );
@@ -54,12 +54,23 @@
5555 ) );
5656 # UI JS
5757 $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;
5865 }
5966
6067 #########
6168 # IMPORTANT:
6269 # When configuring globals, add them to localsettings.php and edit them THERE
6370
 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+
6475 # Revision tagging can slow development...
6576 # For example, the main user base may become complacent,
6677 # perhaps treat flagged pages as "done",
@@ -72,6 +83,7 @@
7384 $wgFlaggedRevComments = false;
7485 # Make user's watch pages when reviewed if they watch pages that they edit
7586 $wgFlaggedRevsWatch = true;
 87+
7688 # How long to cache stable versions? (seconds)
7789 $wgFlaggedRevsExpire = 7 * 24 * 3600;
7890
@@ -80,7 +92,7 @@
8193 # Define the tags we can use to rate an article,
8294 # and set the minimum level to have it become a "quality" version.
8395 # "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 );
8597 # How high can we rate these revisions?
8698 $wgFlaggedRevValues = 4;
8799 # Who can set what flags to what level? (use -1 for not at all)
@@ -93,30 +105,20 @@
94106 'style' => array('review' => 3),
95107 );
96108
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 -
105109 # Lets some users access the review UI and set some flags
106110 $wgAvailableRights[] = 'review';
107111 # Let some users set higher settings
108112 $wgAvailableRights[] = 'validate';
109113
110114 # 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;
114116 $wgGroupPermissions['editor']['unwatchedpages'] = true;
115 -$wgGroupPermissions['editor']['autoconfirmed'] = true;
 117+$wgGroupPermissions['editor']['autoconfirmed'] = true;
116118
117119 # Defines extra rights for advanced reviewer class
118 -$wgGroupPermissions['reviewer']['validate'] = true;
 120+$wgGroupPermissions['reviewer']['validate'] = true;
119121 # Let this stand alone just in case...
120 -$wgGroupPermissions['reviewer']['review'] = true;
 122+$wgGroupPermissions['reviewer']['review'] = true;
121123
122124 # Define when users get automatically promoted to editors
123125 # Set to false to disable this
@@ -1025,7 +1027,7 @@
10261028 }
10271029
10281030 function addReviewForm( $out ) {
1029 - global $wgArticle, $action;
 1031+ global $wgArticle, $wgRequest, $action;
10301032
10311033 if( !$wgArticle || !$wgArticle->exists() || !$wgArticle->mTitle->isContentPage() || $action !='view' )
10321034 return true;
@@ -1034,7 +1036,7 @@
10351037 return true;
10361038 }
10371039 // Get revision ID
1038 - $revId = ( $wgArticle->mRevision ) ? $wgArticle->mRevision->mId : $wgArticle->getLatest();
 1040+ $revId = $out->mRevisionId ? $out->mRevisionId : $wgArticle->getLatest();
10391041 // We cannot review deleted revisions
10401042 if( is_object($wgArticle->mRevision) && $wgArticle->mRevision->mDeleted )
10411043 return true;

Status & tagging log