r62100 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62099‎ | r62100 | r62101 >
Date:22:22, 7 February 2010
Author:aaron
Status:ok
Tags:
Comment:
Renamed functions: isPagePatrollable -> inPatrolNamespace, isPageReviewable -> inReviewNamespace
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiReview.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiStabilize.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc
@@ -35,7 +35,7 @@
3636 # Is it already reviewed?
3737 $frev = FlaggedRevision::newFromTitle( $title, $row->page_latest, FR_MASTER );
3838 # Should exist, but to be safe...
39 - if( !$frev && $rev && FlaggedRevs::isPageReviewable($title) ) {
 39+ if( !$frev && $rev && FlaggedRevs::inReviewNamespace($title) ) {
4040 $text = $rev->getText();
4141 $article = new Article( $title );
4242 FlaggedRevs::autoReviewEdit( $article, $user, $text, $rev, $flags, true );
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -71,7 +71,7 @@
7272 * @param bool $titleOnly, only check if title is in reviewable namespace
7373 */
7474 public function isReviewable( $titleOnly = false ) {
75 - if ( !FlaggedRevs::isPageReviewable( $this->getTitle() ) ) {
 75+ if ( !FlaggedRevs::inReviewNamespace( $this->getTitle() ) ) {
7676 return false;
7777 } elseif ( !$titleOnly && FlaggedRevs::forDefaultVersionOnly()
7878 && !$this->isStableShownByDefault() )
@@ -87,7 +87,7 @@
8888 * @return bool
8989 */
9090 public function isPatrollable( $titleOnly = false ) {
91 - if ( FlaggedRevs::isPagePatrollable( $this->getTitle() ) ) {
 91+ if ( FlaggedRevs::inPatrolNamespace( $this->getTitle() ) ) {
9292 return true;
9393 } elseif ( !$titleOnly && FlaggedRevs::forDefaultVersionOnly()
9494 && !$this->isStableShownByDefault() )
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -1369,7 +1369,7 @@
13701370 * @param Title, $title
13711371 * @return bool
13721372 */
1373 - public static function isPageReviewable( $title ) {
 1373+ public static function inReviewNamespace( $title ) {
13741374 global $wgFlaggedRevsWhitelist;
13751375 $namespaces = self::getReviewNamespaces();
13761376 $ns = ( $title->getNamespace() == NS_MEDIA ) ?
@@ -1382,11 +1382,11 @@
13831383 }
13841384
13851385 /**
1386 - * Is this page in patrolable namespace?
 1386+ * Is this page in patrollable namespace?
13871387 * @param Title, $title
13881388 * @return bool
13891389 */
1390 - public static function isPagePatrollable( $title ) {
 1390+ public static function inPatrolNamespace( $title ) {
13911391 $namespaces = self::getPatrolNamespaces();
13921392 $ns = ( $title->getNamespace() == NS_MEDIA ) ?
13931393 NS_FILE : $title->getNamespace(); // Treat NS_MEDIA as NS_FILE
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -59,7 +59,7 @@
6060 } elseif ( !$this->page->exists() ) {
6161 return $wgOut->addHTML( wfMsgExt( 'stabilization-notexists', array( 'parseinline' ),
6262 $this->page->getPrefixedText() ) );
63 - } elseif ( !FlaggedRevs::isPageReviewable( $this->page ) ) {
 63+ } elseif ( !FlaggedRevs::inReviewNamespace( $this->page ) ) {
6464 return $wgOut->addHTML( wfMsgExt( 'stabilization-notcontent', array( 'parseinline' ),
6565 $this->page->getPrefixedText() ) );
6666 }
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -78,7 +78,7 @@
7979 private function markReviewed() {
8080 global $wgRequest, $wgOut, $wgUser;
8181 # Must be in reviewable namespace
82 - if ( !FlaggedRevs::isPageReviewable( $this->page ) ) {
 82+ if ( !FlaggedRevs::inReviewNamespace( $this->page ) ) {
8383 $wgOut->addHTML( wfMsgExt( 'revreview-main', array( 'parse' ) ) );
8484 return;
8585 }
@@ -197,7 +197,7 @@
198198 {
199199 case "target":
200200 $form->page = Title::newFromUrl( $val );
201 - if ( is_null( $form->page ) || !FlaggedRevs::isPageReviewable( $form->page ) ) {
 201+ if ( is_null( $form->page ) || !FlaggedRevs::inReviewNamespace( $form->page ) ) {
202202 return '<err#>' . wfMsgExt( 'revreview-failed', 'parseinline' );
203203 }
204204 break;
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php
@@ -33,7 +33,7 @@
3434 protected function showStableList() {
3535 global $wgOut, $wgUser;
3636 # Must be a content page
37 - if ( !FlaggedRevs::isPageReviewable( $this->page ) ) {
 37+ if ( !FlaggedRevs::inReviewNamespace( $this->page ) ) {
3838 $wgOut->addHTML( wfMsgExt( 'reviewedversions-none', array( 'parse' ),
3939 $this->page->getPrefixedText() ) );
4040 return;
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -236,7 +236,7 @@
237237 if ( $fa->isReviewable() ) {
238238 // Moved from non-reviewable to reviewable NS?
239239 if ( FlaggedRevs::autoReviewNewPages() && $user->isAllowed( 'autoreview' )
240 - && !FlaggedRevs::isPageReviewable( $otitle ) )
 240+ && !FlaggedRevs::inReviewNamespace( $otitle ) )
241241 {
242242 $rev = Revision::newFromTitle( $ntitle );
243243 // Treat this kind of like a new page...
@@ -460,7 +460,7 @@
461461 # Should be in reviewable namespace, this saves unneeded DB checks as
462462 # well as enforce site settings if they are later changed.
463463 if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE
464 - && FlaggedRevs::isPageReviewable( $title ) && $title->getArticleId() )
 464+ && FlaggedRevs::inReviewNamespace( $title ) && $title->getArticleId() )
465465 {
466466 $id = $dbr->selectField( 'flaggedpages', 'fp_stable',
467467 array( 'fp_page_id' => $title->getArticleId() ),
@@ -533,7 +533,7 @@
534534 # well as enforce site settings if they are later changed.
535535 $sha1 = '';
536536 if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE
537 - && FlaggedRevs::isPageReviewable( $title ) )
 537+ && FlaggedRevs::inReviewNamespace( $title ) )
538538 {
539539 $srev = FlaggedRevision::newFromStable( $title );
540540 if ( $srev && $srev->getFileTimestamp() ) {
@@ -627,7 +627,7 @@
628628 # well as enforce site settings if they are later changed.
629629 $sha1 = "";
630630 if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE
631 - && FlaggedRevs::isPageReviewable( $nt ) )
 631+ && FlaggedRevs::inReviewNamespace( $nt ) )
632632 {
633633 $srev = FlaggedRevision::newFromStable( $nt );
634634 if ( $srev && $srev->getFileTimestamp() ) {
@@ -773,7 +773,7 @@
774774 }
775775 # Don't let users vandalize pages by moving them...
776776 if ( $action === 'move' ) {
777 - if ( !FlaggedRevs::isPageReviewable( $title ) || !$title->exists() )
 777+ if ( !FlaggedRevs::inReviewNamespace( $title ) || !$title->exists() )
778778 return true;
779779 $flaggedArticle = FlaggedArticle::getTitleInstance( $title );
780780 # If the current shows be default anyway, nothing to do...
@@ -791,7 +791,7 @@
792792 # Pages in reviewable namespace can be patrolled IF reviewing
793793 # is disabled for pages that don't show the stable by default.
794794 # In such cases, we let people with 'review' rights patrol them.
795 - if ( FlaggedRevs::isPageReviewable( $title ) && !$user->isAllowed( 'review' ) ) {
 795+ if ( FlaggedRevs::inReviewNamespace( $title ) && !$user->isAllowed( 'review' ) ) {
796796 $result = false;
797797 return false;
798798 }
@@ -1005,7 +1005,7 @@
10061006 # Must be in reviewable namespace
10071007 $title = $article->getTitle();
10081008 # Revision must *be* null (null edit). We also need the user who made the edit.
1009 - if ( !$user || $rev !== null || !FlaggedRevs::isPageReviewable( $title ) ) {
 1009+ if ( !$user || $rev !== null || !FlaggedRevs::inReviewNamespace( $title ) ) {
10101010 return true;
10111011 }
10121012 # Get the current revision ID
@@ -1047,7 +1047,7 @@
10481048 return true;
10491049 }
10501050 // Is the page reviewable?
1051 - if ( FlaggedRevs::isPageReviewable( $rc->getTitle() ) ) {
 1051+ if ( FlaggedRevs::inReviewNamespace( $rc->getTitle() ) ) {
10521052 # Note: pages in reviewable namespace with FR disabled
10531053 # won't autopatrol. May or may not be useful...
10541054 $quality = FlaggedRevs::getRevQuality( $rc->mAttribs['rc_cur_id'],
@@ -1061,7 +1061,7 @@
10621062 }
10631063 // Is this page in patrollable namespace?
10641064 $patrol = $record = false;
1065 - if ( FlaggedRevs::isPagePatrollable( $rc->getTitle() ) ) {
 1065+ if ( FlaggedRevs::inPatrolNamespace( $rc->getTitle() ) ) {
10661066 # Bots and users with 'autopatrol' have edits to patrolleable pages
10671067 # marked automatically on edit.
10681068 $patrol = $wgUser->isAllowed( 'autopatrol' ) || $wgUser->isAllowed( 'bot' );
@@ -1617,7 +1617,7 @@
16181618 &$title, $request, &$ignoreRedirect, &$target, &$article
16191619 ) {
16201620 # Get an instance on the title ($wgTitle)
1621 - if ( !FlaggedRevs::isPageReviewable( $title ) ) {
 1621+ if ( !FlaggedRevs::inReviewNamespace( $title ) ) {
16221622 return true;
16231623 }
16241624 if ( $request->getVal( 'stableid' ) ) {
@@ -1878,7 +1878,7 @@
18791879 ) {
18801880 if ( empty( $rc->mAttribs['fpp_rev_id'] ) )
18811881 return true; // page is not listed in pending edit table
1882 - if ( !FlaggedRevs::isPageReviewable( $rc->getTitle() ) )
 1882+ if ( !FlaggedRevs::inReviewNamespace( $rc->getTitle() ) )
18831883 return true; // confirm that page is in reviewable namespace
18841884 $rlink = $list->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'revreview-reviewlink' ),
18851885 'oldid=' . intval( $rc->mAttribs['fpp_rev_id'] ) . '&diff=cur' );
@@ -2015,7 +2015,7 @@
20162016 global $wgUser, $wgRequest, $wgOut, $wgLang;
20172017 if ( !FlaggedRevs::useProtectionLevels() || !$article->exists() ) {
20182018 return true; // nothing to do
2019 - } else if ( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) {
 2019+ } else if ( !FlaggedRevs::inReviewNamespace( $article->getTitle() ) ) {
20202020 return true; // not a reviewable page
20212021 }
20222022 # Can the user actually do anything?
@@ -2148,7 +2148,7 @@
21492149 public static function insertStabilityLog( $article, $out ) {
21502150 if ( !FlaggedRevs::useProtectionLevels() || !$article->exists() ) {
21512151 return true; // nothing to do
2152 - } else if ( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) {
 2152+ } else if ( !FlaggedRevs::inReviewNamespace( $article->getTitle() ) ) {
21532153 return true; // not a reviewable page
21542154 }
21552155 # Show relevant lines from the stability log:
@@ -2166,7 +2166,7 @@
21672167 if ( wfReadOnly() || !$wgUser->isAllowed( 'stablesettings' ) ) {
21682168 return true; // user cannot change anything
21692169 }
2170 - if ( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) {
 2170+ if ( !FlaggedRevs::inReviewNamespace( $article->getTitle() ) ) {
21712171 return true; // not a reviewable page
21722172 }
21732173 $form = new Stabilization();
Index: trunk/extensions/FlaggedRevs/api/ApiReview.php
@@ -53,7 +53,7 @@
5454 $form->oldid = $revid;
5555 $title = $rev->getTitle();
5656 $form->page = $title;
57 - if( !FlaggedRevs::isPageReviewable( $title ) )
 57+ if( !FlaggedRevs::inReviewNamespace( $title ) )
5858 $this->dieUsage( "Provided revision or page can not be reviewed.", 'notreviewable' );
5959
6060 if( isset( $params['unapprove'] ) )
Index: trunk/extensions/FlaggedRevs/api/ApiStabilize.php
@@ -43,7 +43,7 @@
4444 if( $title == null ) {
4545 $this->dieUsage( "Invalid title given.", "invalidtitle" );
4646 }
47 - if( !FlaggedRevs::isPageReviewable($title) ) {
 47+ if( !FlaggedRevs::inReviewNamespace($title) ) {
4848 $this->dieUsage( "Title given does not correspond to a reviewable page.", "invalidtitle" );
4949 }
5050 $errors = $title->getUserPermissionsErrors('stablesettings', $wgUser);
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -981,7 +981,7 @@
982982 return true; // simple custom levels set for action=protect
983983 }
984984 $title = $this->article->getTitle()->getSubjectPage();
985 - if ( !FlaggedRevs::isPageReviewable( $title ) ) {
 985+ if ( !FlaggedRevs::inReviewNamespace( $title ) ) {
986986 return true; // Only reviewable pages need these tabs
987987 }
988988 // Check if we should show a stabilization tab

Status & tagging log