Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -191,6 +191,7 @@ |
192 | 192 | ); |
193 | 193 | if( $change instanceof RecentChange ) { |
194 | 194 | $rcid = $change->mAttribs['rc_id']; |
| 195 | + $this->mRcidMarkPatrolled = $rcid; |
195 | 196 | } else { |
196 | 197 | // None found |
197 | 198 | $rcid = 0; |
— | — | @@ -198,11 +199,8 @@ |
199 | 200 | } |
200 | 201 | // Build the link |
201 | 202 | if( $rcid ) { |
202 | | - $patrol = ' <span class="patrollink">[' . $sk->makeKnownLinkObj( |
203 | | - $this->mTitle, |
204 | | - wfMsgHtml( 'markaspatrolleddiff' ), |
205 | | - "action=markpatrolled&rcid={$rcid}" |
206 | | - ) . ']</span>'; |
| 203 | + $patrol = ' <span class="patrollink">[' . $sk->makeKnownLinkObj( $this->mTitle, |
| 204 | + wfMsgHtml( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$rcid}" ) . ']</span>'; |
207 | 205 | } else { |
208 | 206 | $patrol = ''; |
209 | 207 | } |
— | — | @@ -297,7 +295,7 @@ |
298 | 296 | * Show the new revision of the page. |
299 | 297 | */ |
300 | 298 | function renderNewRevision() { |
301 | | - global $wgOut; |
| 299 | + global $wgOut, $wgUser; |
302 | 300 | wfProfileIn( __METHOD__ ); |
303 | 301 | |
304 | 302 | $wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" ); |
— | — | @@ -332,9 +330,18 @@ |
333 | 331 | $wgOut->addWikiTextTidy( $this->mNewtext ); |
334 | 332 | } |
335 | 333 | |
336 | | - if( !$this->mNewRev->isCurrent() ) { |
| 334 | + if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) { |
337 | 335 | $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); |
338 | 336 | } |
| 337 | + # Add redundant patrol link on bottom... |
| 338 | + if( $this->mRcidMarkPatrolled && $this->mTitle->quickUserCan('patrol') ) { |
| 339 | + $sk = $wgUser->getSkin(); |
| 340 | + $wgOut->addHTML( |
| 341 | + "<div class='patrollink'>[" . $sk->makeKnownLinkObj( $this->mTitle, |
| 342 | + wfMsgHtml( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . |
| 343 | + ']</div>' |
| 344 | + ); |
| 345 | + } |
339 | 346 | |
340 | 347 | wfProfileOut( __METHOD__ ); |
341 | 348 | } |