* Bug 4456: Add hook for marking article patrolled
authorRob Church <robchurch@users.mediawiki.org>
Tue, 3 Jan 2006 15:45:36 +0000 (15:45 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 3 Jan 2006 15:45:36 +0000 (15:45 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/Article.php

index 845a0ef..e0311cd 100644 (file)
@@ -398,6 +398,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * Removed broken wgAllowAnonymousMinor and added new group right minoredit
 * (bug 4457) Update for Portuguese language (pt)
 * convertPlural breakage fixed a little
+* Bug 4456: Add hook for marking article patrolled
 
 
 === Caveats ===
index 028d8fa..ae05905 100644 (file)
@@ -332,6 +332,18 @@ $typeText: array of strings
 'LogPageLogHeader': strings used by wfMsg as a header.
 $headerText: array of strings
 
+'MarkPatrolled': before an edit is marked patrolled
+$rcid: ID of the revision to be marked patrolled
+$user: the user (object) marking the revision as patrolled
+$wcOnlySysopsCanPatrol: config setting indicating whether the user
+ needs to be a sysop in order to mark an edit patrolled
+
+'MarkPatrolledComplete': after an edit is marked patrolled
+$rcid: ID of the revision marked as patrolled
+$user: user (object) who marked the edit patrolled
+$wcOnlySysopsCanPatrol: config setting indicating whether the user
+ must be a sysop to patrol the edit
+
 'PageRenderingHash': alter the parser cache option hash key
   A parser extension which depends on user options should install
   this hook and append its values to the key.
index 640a510..6530045 100644 (file)
@@ -1499,10 +1499,12 @@ class Article {
                $rcid = $wgRequest->getVal( 'rcid' );
                if ( !is_null ( $rcid ) )
                {
-                       RecentChange::markPatrolled( $rcid );
-                       $wgOut->setPagetitle( wfMsg( 'markedaspatrolled' ) );
-                       $wgOut->addWikiText( wfMsg( 'markedaspatrolledtext' ) );
-
+                       if( wfRunHooks( 'MarkPatrolled', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) ) ) {
+                               RecentChange::markPatrolled( $rcid );
+                               wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) );
+                               $wgOut->setPagetitle( wfMsg( 'markedaspatrolled' ) );
+                               $wgOut->addWikiText( wfMsg( 'markedaspatrolledtext' ) );
+                       }
                        $rcTitle = Title::makeTitle( NS_SPECIAL, 'Recentchanges' );
                        $wgOut->returnToMain( false, $rcTitle->getPrefixedText() );
                }