From 2437a0a1a085a95f481b0b5c1c81d2f9e669559c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 12 Feb 2009 14:45:10 +0000 Subject: [PATCH] (bug 5776) Add extra patrol link on bottom for diffs --- includes/diff/DifferenceEngine.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index ce07858906..5bd947c069 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -191,6 +191,7 @@ CONTROL; ); if( $change instanceof RecentChange ) { $rcid = $change->mAttribs['rc_id']; + $this->mRcidMarkPatrolled = $rcid; } else { // None found $rcid = 0; @@ -198,11 +199,8 @@ CONTROL; } // Build the link if( $rcid ) { - $patrol = ' [' . $sk->makeKnownLinkObj( - $this->mTitle, - wfMsgHtml( 'markaspatrolleddiff' ), - "action=markpatrolled&rcid={$rcid}" - ) . ']'; + $patrol = ' [' . $sk->makeKnownLinkObj( $this->mTitle, + wfMsgHtml( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$rcid}" ) . ']'; } else { $patrol = ''; } @@ -297,7 +295,7 @@ CONTROL; * Show the new revision of the page. */ function renderNewRevision() { - global $wgOut; + global $wgOut, $wgUser; wfProfileIn( __METHOD__ ); $wgOut->addHTML( "

{$this->mPagetitle}

\n" ); @@ -332,9 +330,18 @@ CONTROL; $wgOut->addWikiTextTidy( $this->mNewtext ); } - if( !$this->mNewRev->isCurrent() ) { + if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) { $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); } + # Add redundant patrol link on bottom... + if( $this->mRcidMarkPatrolled && $this->mTitle->quickUserCan('patrol') ) { + $sk = $wgUser->getSkin(); + $wgOut->addHTML( + "' + ); + } wfProfileOut( __METHOD__ ); } -- 2.20.1