r28769 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28768‎ | r28769 | r28770 >
Date:02:32, 22 December 2007
Author:aaron
Status:old
Tags:
Comment:
Some patrol cleanup
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/Language/FlaggedRevsPage.i18n.en.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -951,10 +951,10 @@
952952 $change = RecentChange::newFromConds(
953953 array(
954954 // Add redundant timestamp condition so we can use the existing index
955 - 'rc_timestamp' => $dbr->timestamp( $diff->mNewRev->getTimestamp() ),
 955+ 'rc_timestamp' => $dbr->timestamp( $diff->mNewRev->getTimestamp() ),
956956 'rc_this_oldid' => $diff->mNewid,
957957 'rc_last_oldid' => $diff->mOldid,
958 - 'rc_patrolled' => 0,
 958+ 'rc_patrolled' => 0,
959959 ),
960960 __METHOD__
961961 );
@@ -970,9 +970,8 @@
971971 $skin = $wgUser->getSkin();
972972
973973 $reviewtitle = SpecialPage::getTitleFor( 'Revisionreview' );
974 - $patrol = '[' . $skin->makeKnownLinkObj( $reviewtitle,
975 - wfMsgHtml( 'markaspatrolleddiff' ),
976 - "patrolonly=1&rcid={$rcid}") . ']';
 974+ $patrol = '[' . $skin->makeKnownLinkObj( $reviewtitle, wfMsgHtml( 'markaspatrolleddiff' ),
 975+ "patrolonly=1&target=" . $NewRev->getTitle()->getPrefixedUrl() . "&rcid={$rcid}" ) . ']';
977976 } else {
978977 $patrol = '';
979978 }
Index: trunk/extensions/FlaggedRevs/Language/FlaggedRevsPage.i18n.en.php
@@ -60,6 +60,7 @@
6161 You may want to preview the page before saving.",
6262 'revreview-auto-w-old' => "You are editing an old revision, any changes will '''automatically be reviewed'''.
6363 You may want to preview the page before saving.",
 64+ 'revreview-patrolled' => 'The selected revision of [[:$1|$1]] has been marked as patrolled.',
6465
6566 'hist-stable' => '[sighted]',
6667 'hist-quality' => '[quality]',
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -33,28 +33,30 @@
3434 }
3535
3636 $this->setHeaders();
 37+ // Our target page
 38+ $this->target = $wgRequest->getText( 'target' );
 39+ $this->page = Title::newFromUrl( $this->target );
3740 // Basic patrolling
3841 $this->patrolonly = $wgRequest->getBool( 'patrolonly' );
3942 $this->rcid = $wgRequest->getIntOrNull( 'rcid' );
 43+
 44+ if( is_null($this->page) ) {
 45+ $wgOut->showErrorPage('notargettitle', 'notargettext' );
 46+ return;
 47+ }
 48+ // Patrol the edit if requested
4049 if( $this->patrolonly && $this->rcid ) {
4150 $this->markPatrolled();
4251 return;
4352 }
4453
4554 global $wgFlaggedRevTags, $wgFlaggedRevValues;
46 - // Our target page
47 - $this->target = $wgRequest->getText( 'target' );
48 - $this->page = Title::newFromUrl( $this->target );
4955 // Revision ID
5056 $this->oldid = $wgRequest->getIntOrNull( 'oldid' );
5157 if( !$this->target || !$this->oldid || !FlaggedRevs::isPageReviewable( $this->page ) ) {
5258 $wgOut->addHTML( wfMsgExt('revreview-main',array('parse')) );
5359 return;
5460 }
55 - if( is_null($this->page) || is_null($this->oldid) ) {
56 - $wgOut->showErrorPage('notargettitle', 'notargettext' );
57 - return;
58 - }
5961 // Check if page is protected
6062 if( !$this->page->quickUserCan( 'edit' ) ) {
6163 $wgOut->permissionRequired( 'badaccess-group0' );
@@ -143,7 +145,7 @@
144146 PatrolLog::record( $this->rcid );
145147 # Inform the user
146148 $wgOut->setPageTitle( wfMsg( 'markedaspatrolled' ) );
147 - $wgOut->addWikiText( wfMsgNoTrans( 'markedaspatrolledtext' ) );
 149+ $wgOut->addWikiText( wfMsgNoTrans( 'revreview-patrolled', $this->page->getPrefixedText() ) );
148150 $wgOut->returnToMain( false, SpecialPage::getTitleFor( 'Recentchanges' ) );
149151 }
150152

Status & tagging log