Index: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | # Is it already reviewed? |
37 | 37 | $frev = FlaggedRevision::newFromTitle( $title, $row->page_latest, FR_MASTER ); |
38 | 38 | # Should exist, but to be safe... |
39 | | - if( !$frev && $rev && FlaggedRevs::isPageReviewable($title) ) { |
| 39 | + if( !$frev && $rev && FlaggedRevs::inReviewNamespace($title) ) { |
40 | 40 | $text = $rev->getText(); |
41 | 41 | $article = new Article( $title ); |
42 | 42 | FlaggedRevs::autoReviewEdit( $article, $user, $text, $rev, $flags, true ); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | * @param bool $titleOnly, only check if title is in reviewable namespace |
73 | 73 | */ |
74 | 74 | public function isReviewable( $titleOnly = false ) { |
75 | | - if ( !FlaggedRevs::isPageReviewable( $this->getTitle() ) ) { |
| 75 | + if ( !FlaggedRevs::inReviewNamespace( $this->getTitle() ) ) { |
76 | 76 | return false; |
77 | 77 | } elseif ( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() |
78 | 78 | && !$this->isStableShownByDefault() ) |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | * @return bool |
89 | 89 | */ |
90 | 90 | public function isPatrollable( $titleOnly = false ) { |
91 | | - if ( FlaggedRevs::isPagePatrollable( $this->getTitle() ) ) { |
| 91 | + if ( FlaggedRevs::inPatrolNamespace( $this->getTitle() ) ) { |
92 | 92 | return true; |
93 | 93 | } elseif ( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() |
94 | 94 | && !$this->isStableShownByDefault() ) |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1369,7 +1369,7 @@ |
1370 | 1370 | * @param Title, $title |
1371 | 1371 | * @return bool |
1372 | 1372 | */ |
1373 | | - public static function isPageReviewable( $title ) { |
| 1373 | + public static function inReviewNamespace( $title ) { |
1374 | 1374 | global $wgFlaggedRevsWhitelist; |
1375 | 1375 | $namespaces = self::getReviewNamespaces(); |
1376 | 1376 | $ns = ( $title->getNamespace() == NS_MEDIA ) ? |
— | — | @@ -1382,11 +1382,11 @@ |
1383 | 1383 | } |
1384 | 1384 | |
1385 | 1385 | /** |
1386 | | - * Is this page in patrolable namespace? |
| 1386 | + * Is this page in patrollable namespace? |
1387 | 1387 | * @param Title, $title |
1388 | 1388 | * @return bool |
1389 | 1389 | */ |
1390 | | - public static function isPagePatrollable( $title ) { |
| 1390 | + public static function inPatrolNamespace( $title ) { |
1391 | 1391 | $namespaces = self::getPatrolNamespaces(); |
1392 | 1392 | $ns = ( $title->getNamespace() == NS_MEDIA ) ? |
1393 | 1393 | NS_FILE : $title->getNamespace(); // Treat NS_MEDIA as NS_FILE |
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | } elseif ( !$this->page->exists() ) { |
61 | 61 | return $wgOut->addHTML( wfMsgExt( 'stabilization-notexists', array( 'parseinline' ), |
62 | 62 | $this->page->getPrefixedText() ) ); |
63 | | - } elseif ( !FlaggedRevs::isPageReviewable( $this->page ) ) { |
| 63 | + } elseif ( !FlaggedRevs::inReviewNamespace( $this->page ) ) { |
64 | 64 | return $wgOut->addHTML( wfMsgExt( 'stabilization-notcontent', array( 'parseinline' ), |
65 | 65 | $this->page->getPrefixedText() ) ); |
66 | 66 | } |
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | private function markReviewed() { |
80 | 80 | global $wgRequest, $wgOut, $wgUser; |
81 | 81 | # Must be in reviewable namespace |
82 | | - if ( !FlaggedRevs::isPageReviewable( $this->page ) ) { |
| 82 | + if ( !FlaggedRevs::inReviewNamespace( $this->page ) ) { |
83 | 83 | $wgOut->addHTML( wfMsgExt( 'revreview-main', array( 'parse' ) ) ); |
84 | 84 | return; |
85 | 85 | } |
— | — | @@ -197,7 +197,7 @@ |
198 | 198 | { |
199 | 199 | case "target": |
200 | 200 | $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 ) ) { |
202 | 202 | return '<err#>' . wfMsgExt( 'revreview-failed', 'parseinline' ); |
203 | 203 | } |
204 | 204 | break; |
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | protected function showStableList() { |
35 | 35 | global $wgOut, $wgUser; |
36 | 36 | # Must be a content page |
37 | | - if ( !FlaggedRevs::isPageReviewable( $this->page ) ) { |
| 37 | + if ( !FlaggedRevs::inReviewNamespace( $this->page ) ) { |
38 | 38 | $wgOut->addHTML( wfMsgExt( 'reviewedversions-none', array( 'parse' ), |
39 | 39 | $this->page->getPrefixedText() ) ); |
40 | 40 | return; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | if ( $fa->isReviewable() ) { |
238 | 238 | // Moved from non-reviewable to reviewable NS? |
239 | 239 | if ( FlaggedRevs::autoReviewNewPages() && $user->isAllowed( 'autoreview' ) |
240 | | - && !FlaggedRevs::isPageReviewable( $otitle ) ) |
| 240 | + && !FlaggedRevs::inReviewNamespace( $otitle ) ) |
241 | 241 | { |
242 | 242 | $rev = Revision::newFromTitle( $ntitle ); |
243 | 243 | // Treat this kind of like a new page... |
— | — | @@ -460,7 +460,7 @@ |
461 | 461 | # Should be in reviewable namespace, this saves unneeded DB checks as |
462 | 462 | # well as enforce site settings if they are later changed. |
463 | 463 | if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE |
464 | | - && FlaggedRevs::isPageReviewable( $title ) && $title->getArticleId() ) |
| 464 | + && FlaggedRevs::inReviewNamespace( $title ) && $title->getArticleId() ) |
465 | 465 | { |
466 | 466 | $id = $dbr->selectField( 'flaggedpages', 'fp_stable', |
467 | 467 | array( 'fp_page_id' => $title->getArticleId() ), |
— | — | @@ -533,7 +533,7 @@ |
534 | 534 | # well as enforce site settings if they are later changed. |
535 | 535 | $sha1 = ''; |
536 | 536 | if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE |
537 | | - && FlaggedRevs::isPageReviewable( $title ) ) |
| 537 | + && FlaggedRevs::inReviewNamespace( $title ) ) |
538 | 538 | { |
539 | 539 | $srev = FlaggedRevision::newFromStable( $title ); |
540 | 540 | if ( $srev && $srev->getFileTimestamp() ) { |
— | — | @@ -627,7 +627,7 @@ |
628 | 628 | # well as enforce site settings if they are later changed. |
629 | 629 | $sha1 = ""; |
630 | 630 | if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE |
631 | | - && FlaggedRevs::isPageReviewable( $nt ) ) |
| 631 | + && FlaggedRevs::inReviewNamespace( $nt ) ) |
632 | 632 | { |
633 | 633 | $srev = FlaggedRevision::newFromStable( $nt ); |
634 | 634 | if ( $srev && $srev->getFileTimestamp() ) { |
— | — | @@ -773,7 +773,7 @@ |
774 | 774 | } |
775 | 775 | # Don't let users vandalize pages by moving them... |
776 | 776 | if ( $action === 'move' ) { |
777 | | - if ( !FlaggedRevs::isPageReviewable( $title ) || !$title->exists() ) |
| 777 | + if ( !FlaggedRevs::inReviewNamespace( $title ) || !$title->exists() ) |
778 | 778 | return true; |
779 | 779 | $flaggedArticle = FlaggedArticle::getTitleInstance( $title ); |
780 | 780 | # If the current shows be default anyway, nothing to do... |
— | — | @@ -791,7 +791,7 @@ |
792 | 792 | # Pages in reviewable namespace can be patrolled IF reviewing |
793 | 793 | # is disabled for pages that don't show the stable by default. |
794 | 794 | # 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' ) ) { |
796 | 796 | $result = false; |
797 | 797 | return false; |
798 | 798 | } |
— | — | @@ -1005,7 +1005,7 @@ |
1006 | 1006 | # Must be in reviewable namespace |
1007 | 1007 | $title = $article->getTitle(); |
1008 | 1008 | # 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 ) ) { |
1010 | 1010 | return true; |
1011 | 1011 | } |
1012 | 1012 | # Get the current revision ID |
— | — | @@ -1047,7 +1047,7 @@ |
1048 | 1048 | return true; |
1049 | 1049 | } |
1050 | 1050 | // Is the page reviewable? |
1051 | | - if ( FlaggedRevs::isPageReviewable( $rc->getTitle() ) ) { |
| 1051 | + if ( FlaggedRevs::inReviewNamespace( $rc->getTitle() ) ) { |
1052 | 1052 | # Note: pages in reviewable namespace with FR disabled |
1053 | 1053 | # won't autopatrol. May or may not be useful... |
1054 | 1054 | $quality = FlaggedRevs::getRevQuality( $rc->mAttribs['rc_cur_id'], |
— | — | @@ -1061,7 +1061,7 @@ |
1062 | 1062 | } |
1063 | 1063 | // Is this page in patrollable namespace? |
1064 | 1064 | $patrol = $record = false; |
1065 | | - if ( FlaggedRevs::isPagePatrollable( $rc->getTitle() ) ) { |
| 1065 | + if ( FlaggedRevs::inPatrolNamespace( $rc->getTitle() ) ) { |
1066 | 1066 | # Bots and users with 'autopatrol' have edits to patrolleable pages |
1067 | 1067 | # marked automatically on edit. |
1068 | 1068 | $patrol = $wgUser->isAllowed( 'autopatrol' ) || $wgUser->isAllowed( 'bot' ); |
— | — | @@ -1617,7 +1617,7 @@ |
1618 | 1618 | &$title, $request, &$ignoreRedirect, &$target, &$article |
1619 | 1619 | ) { |
1620 | 1620 | # Get an instance on the title ($wgTitle) |
1621 | | - if ( !FlaggedRevs::isPageReviewable( $title ) ) { |
| 1621 | + if ( !FlaggedRevs::inReviewNamespace( $title ) ) { |
1622 | 1622 | return true; |
1623 | 1623 | } |
1624 | 1624 | if ( $request->getVal( 'stableid' ) ) { |
— | — | @@ -1878,7 +1878,7 @@ |
1879 | 1879 | ) { |
1880 | 1880 | if ( empty( $rc->mAttribs['fpp_rev_id'] ) ) |
1881 | 1881 | return true; // page is not listed in pending edit table |
1882 | | - if ( !FlaggedRevs::isPageReviewable( $rc->getTitle() ) ) |
| 1882 | + if ( !FlaggedRevs::inReviewNamespace( $rc->getTitle() ) ) |
1883 | 1883 | return true; // confirm that page is in reviewable namespace |
1884 | 1884 | $rlink = $list->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'revreview-reviewlink' ), |
1885 | 1885 | 'oldid=' . intval( $rc->mAttribs['fpp_rev_id'] ) . '&diff=cur' ); |
— | — | @@ -2015,7 +2015,7 @@ |
2016 | 2016 | global $wgUser, $wgRequest, $wgOut, $wgLang; |
2017 | 2017 | if ( !FlaggedRevs::useProtectionLevels() || !$article->exists() ) { |
2018 | 2018 | return true; // nothing to do |
2019 | | - } else if ( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { |
| 2019 | + } else if ( !FlaggedRevs::inReviewNamespace( $article->getTitle() ) ) { |
2020 | 2020 | return true; // not a reviewable page |
2021 | 2021 | } |
2022 | 2022 | # Can the user actually do anything? |
— | — | @@ -2148,7 +2148,7 @@ |
2149 | 2149 | public static function insertStabilityLog( $article, $out ) { |
2150 | 2150 | if ( !FlaggedRevs::useProtectionLevels() || !$article->exists() ) { |
2151 | 2151 | return true; // nothing to do |
2152 | | - } else if ( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { |
| 2152 | + } else if ( !FlaggedRevs::inReviewNamespace( $article->getTitle() ) ) { |
2153 | 2153 | return true; // not a reviewable page |
2154 | 2154 | } |
2155 | 2155 | # Show relevant lines from the stability log: |
— | — | @@ -2166,7 +2166,7 @@ |
2167 | 2167 | if ( wfReadOnly() || !$wgUser->isAllowed( 'stablesettings' ) ) { |
2168 | 2168 | return true; // user cannot change anything |
2169 | 2169 | } |
2170 | | - if ( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { |
| 2170 | + if ( !FlaggedRevs::inReviewNamespace( $article->getTitle() ) ) { |
2171 | 2171 | return true; // not a reviewable page |
2172 | 2172 | } |
2173 | 2173 | $form = new Stabilization(); |
Index: trunk/extensions/FlaggedRevs/api/ApiReview.php |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | $form->oldid = $revid; |
55 | 55 | $title = $rev->getTitle(); |
56 | 56 | $form->page = $title; |
57 | | - if( !FlaggedRevs::isPageReviewable( $title ) ) |
| 57 | + if( !FlaggedRevs::inReviewNamespace( $title ) ) |
58 | 58 | $this->dieUsage( "Provided revision or page can not be reviewed.", 'notreviewable' ); |
59 | 59 | |
60 | 60 | if( isset( $params['unapprove'] ) ) |
Index: trunk/extensions/FlaggedRevs/api/ApiStabilize.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | if( $title == null ) { |
45 | 45 | $this->dieUsage( "Invalid title given.", "invalidtitle" ); |
46 | 46 | } |
47 | | - if( !FlaggedRevs::isPageReviewable($title) ) { |
| 47 | + if( !FlaggedRevs::inReviewNamespace($title) ) { |
48 | 48 | $this->dieUsage( "Title given does not correspond to a reviewable page.", "invalidtitle" ); |
49 | 49 | } |
50 | 50 | $errors = $title->getUserPermissionsErrors('stablesettings', $wgUser); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -981,7 +981,7 @@ |
982 | 982 | return true; // simple custom levels set for action=protect |
983 | 983 | } |
984 | 984 | $title = $this->article->getTitle()->getSubjectPage(); |
985 | | - if ( !FlaggedRevs::isPageReviewable( $title ) ) { |
| 985 | + if ( !FlaggedRevs::inReviewNamespace( $title ) ) { |
986 | 986 | return true; // Only reviewable pages need these tabs |
987 | 987 | } |
988 | 988 | // Check if we should show a stabilization tab |