Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | $db->delete( 'flaggedpage_config', |
143 | 143 | array( "fpc_page_id BETWEEN $blockStart AND $blockEnd", |
144 | 144 | 'fpc_select' => FlaggedRevs::getPrecedence(), |
145 | | - 'fpc_override' => intval( FlaggedRevs::showStableByDefault() ) |
| 145 | + 'fpc_override' => intval( FlaggedRevs::isStableShownByDefault() ) |
146 | 146 | ), |
147 | 147 | __FUNCTION__ |
148 | 148 | ); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | * Is the stable version shown by default for this page? |
37 | 37 | * @returns bool |
38 | 38 | */ |
39 | | - public function showStableByDefault() { |
| 39 | + public function isStableShownByDefault() { |
40 | 40 | # Get page configuration |
41 | 41 | $config = $this->getVisibilitySettings(); |
42 | 42 | return (bool)$config['override']; |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | * @returns bool |
48 | 48 | */ |
49 | 49 | public function limitedUI() { |
50 | | - return ( FlaggedRevs::forDefaultVersionOnly() && !$this->showStableByDefault() ); |
| 50 | + return ( FlaggedRevs::forDefaultVersionOnly() && !$this->isStableShownByDefault() ); |
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | * @returns bool |
56 | 56 | */ |
57 | 57 | public function isPageLocked() { |
58 | | - return ( !FlaggedRevs::showStableByDefault() && $this->showStableByDefault() ); |
| 58 | + return ( !FlaggedRevs::isStableShownByDefault() && $this->isStableShownByDefault() ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | * @returns bool |
64 | 64 | */ |
65 | 65 | public function isPageUnlocked() { |
66 | | - return ( FlaggedRevs::showStableByDefault() && !$this->showStableByDefault() ); |
| 66 | + return ( FlaggedRevs::isStableShownByDefault() && !$this->isStableShownByDefault() ); |
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | */ |
73 | 73 | public function lowProfileUI() { |
74 | 74 | return FlaggedRevs::lowProfileUI() && |
75 | | - FlaggedRevs::showStableByDefault() == $this->showStableByDefault(); |
| 75 | + FlaggedRevs::isStableShownByDefault() == $this->isStableShownByDefault(); |
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | if( !FlaggedRevs::isPageReviewable( $this->getTitle() ) ) { |
84 | 84 | return false; |
85 | 85 | } elseif( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() |
86 | | - && !$this->showStableByDefault() ) |
| 86 | + && !$this->isStableShownByDefault() ) |
87 | 87 | { |
88 | 88 | return false; |
89 | 89 | } |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | if( FlaggedRevs::isPagePatrollable( $this->getTitle() ) ) { |
100 | 100 | return true; |
101 | 101 | } elseif( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() |
102 | | - && !$this->showStableByDefault() ) |
| 102 | + && !$this->isStableShownByDefault() ) |
103 | 103 | { |
104 | 104 | return true; |
105 | 105 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | * Should this user see stable versions by default? |
201 | 201 | * @returns bool |
202 | 202 | */ |
203 | | - public static function showStableByDefault() { |
| 203 | + public static function isStableShownByDefault() { |
204 | 204 | global $wgFlaggedRevsOverride; |
205 | 205 | return (bool)$wgFlaggedRevsOverride; |
206 | 206 | } |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | * @returns bool |
220 | 220 | */ |
221 | 221 | public static function stableOnlyIfConfigured() { |
222 | | - return self::forDefaultVersionOnly() && !self::showStableByDefault(); |
| 222 | + return self::forDefaultVersionOnly() && !self::isStableShownByDefault(); |
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
— | — | @@ -1223,7 +1223,7 @@ |
1224 | 1224 | 'select' => self::getPrecedence(), |
1225 | 1225 | # Keep this consistent across settings: |
1226 | 1226 | ## 1 -> override, 0 -> don't |
1227 | | - 'override' => self::showStableByDefault() ? 1 : 0, |
| 1227 | + 'override' => self::isStableShownByDefault() ? 1 : 0, |
1228 | 1228 | 'autoreview' => '', |
1229 | 1229 | 'expiry' => 'infinity' |
1230 | 1230 | ); |
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php |
— | — | @@ -392,7 +392,7 @@ |
393 | 393 | global $wgUser, $wgContLang; |
394 | 394 | $changed = $reset = false; |
395 | 395 | $defaultPrecedence = FlaggedRevs::getPrecedence(); |
396 | | - $defaultOverride = FlaggedRevs::showStableByDefault(); |
| 396 | + $defaultOverride = FlaggedRevs::isStableShownByDefault(); |
397 | 397 | if( $this->select == $defaultPrecedence && $this->override == $defaultOverride ) |
398 | 398 | { |
399 | 399 | $reset = ($this->autoreview == ''); // we are going back to site defaults |
Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | FlaggedRevsXML::getLevelMenu( $this->level, 'revreview-filter-stable' ) . '</span> ' |
72 | 72 | : "" |
73 | 73 | ) . |
74 | | - ( (!FlaggedRevs::showStableByDefault() && !FlaggedRevs::forDefaultVersionOnly()) ? |
| 74 | + ( (!FlaggedRevs::isStableShownByDefault() && !FlaggedRevs::forDefaultVersionOnly()) ? |
75 | 75 | "<span style='white-space: nowrap;'>" . |
76 | 76 | Xml::check( 'stable', $this->stable, array( 'id' => 'wpStable' ) ) . |
77 | 77 | Xml::label( wfMsg('oldreviewed-stable'), 'wpStable' ) . '</span> ' |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | $this->category = $category ? str_replace(' ','_',$category) : null; |
309 | 309 | $this->size = ($size !== null) ? intval($size) : null; |
310 | 310 | $this->watched = (bool)$watched; |
311 | | - $this->stable = $stable && !FlaggedRevs::showStableByDefault() |
| 311 | + $this->stable = $stable && !FlaggedRevs::isStableShownByDefault() |
312 | 312 | && !FlaggedRevs::forDefaultVersionOnly(); |
313 | 313 | parent::__construct(); |
314 | 314 | // Don't get to expensive |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -175,9 +175,7 @@ |
176 | 176 | * Update flaggedrevs tracking tables |
177 | 177 | */ |
178 | 178 | public static function onArticleDelete( &$article, &$user, $reason, $id ) { |
179 | | - $dbw = wfGetDB( DB_MASTER ); |
180 | | - $dbw->delete( 'flaggedpage_config', array( 'fpc_page_id' => $id ), __METHOD__ ); |
181 | | - $dbw->delete( 'flaggedpage_pending', array( 'fpp_page_id' => $id ), __METHOD__ ); |
| 179 | + FlaggedRevs::clearTrackingRows( $id ); |
182 | 180 | return true; |
183 | 181 | } |
184 | 182 | |
— | — | @@ -720,7 +718,7 @@ |
721 | 719 | return true; |
722 | 720 | $flaggedArticle = FlaggedArticle::getTitleInstance( $title ); |
723 | 721 | # If the current shows be default anyway, nothing to do... |
724 | | - if( !$flaggedArticle->showStableByDefault() ) { |
| 722 | + if( !$flaggedArticle->isStableShownByDefault() ) { |
725 | 723 | return true; |
726 | 724 | } |
727 | 725 | $frev = $flaggedArticle->getStableRev(); |
— | — | @@ -1638,7 +1636,8 @@ |
1639 | 1637 | public static function addToFileHistQuery( |
1640 | 1638 | $file, &$tables, &$fields, &$conds, &$opts, &$join_conds |
1641 | 1639 | ) { |
1642 | | - if( !$file->isLocal() ) return true; // local files only |
| 1640 | + if( !$file->isLocal() ) |
| 1641 | + return true; // local files only |
1643 | 1642 | $flaggedArticle = FlaggedArticle::getTitleInstance( $file->getTitle() ); |
1644 | 1643 | # Non-content pages cannot be validated. Stable version must exist. |
1645 | 1644 | if( $flaggedArticle->isReviewable() && $flaggedArticle->getStableRev() ) { |
— | — | @@ -2071,7 +2070,7 @@ |
2072 | 2071 | $selected = $wgRequest->getVal( 'mwStabilityConfig' ); |
2073 | 2072 | if( $selected == "none" ) { |
2074 | 2073 | $form->select = FlaggedRevs::getPrecedence(); // default |
2075 | | - $form->override = (int)FlaggedRevs::showStableByDefault(); // default |
| 2074 | + $form->override = (int)FlaggedRevs::isStableShownByDefault(); // default |
2076 | 2075 | $form->autoreview = ''; // default |
2077 | 2076 | $form->reviewThis = false; |
2078 | 2077 | } else if( isset($levels[$selected]) ) { |
Index: trunk/extensions/FlaggedRevs/api/ApiStabilize.php |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | $selected = $params['protectlevel']; |
75 | 75 | if( $selected == "none" ) { |
76 | 76 | $form->select = FlaggedRevs::getPrecedence(); // default |
77 | | - $form->override = (int)FlaggedRevs::showStableByDefault(); // default |
| 77 | + $form->override = (int)FlaggedRevs::isStableShownByDefault(); // default |
78 | 78 | $form->autoreview = ''; // default |
79 | 79 | } else if( isset($levels[$selected]) ) { |
80 | 80 | $form->select = $levels[$selected]['select']; |
Index: trunk/extensions/FlaggedRevs/README.txt |
— | — | @@ -22,11 +22,27 @@ |
23 | 23 | expains these further. |
24 | 24 | |
25 | 25 | == Uninstallation == |
26 | | -* Remove the include line from LocalSettings.php |
27 | | -* Drop the tables in FlaggedRevs.sql. Drop the columns 'page_ext_reviewed', 'page_ext_quality' and 'page_ext_stable', |
28 | | -and the index 'ext_namespace_reviewed' from the page table. |
29 | | -* Run maintenance/refreshLinks.php from the command line to flush out the stable version links |
| 26 | +* Remove the FlaggedRevs include line from LocalSettings.php. |
| 27 | +* Run maintenance/refreshLinks.php from the command line to flush out the stable version links. |
| 28 | +* Drop the tables in FlaggedRevs.sql to free up disk space. You can use the following query: |
30 | 29 | |
| 30 | + -- Replace /*_*/ with the proper DB prefix |
| 31 | + DROP TABLE IF EXISTS /*_*/flaggedpages; |
| 32 | + DROP TABLE IF EXISTS /*_*/flaggedpage_pending; |
| 33 | + DROP TABLE IF EXISTS /*_*/flaggedrevs; |
| 34 | + DROP TABLE IF EXISTS/*_*/flaggedtemplates; |
| 35 | + DROP TABLE IF EXISTS /*_*/flaggedimages; |
| 36 | + DROP TABLE IF EXISTS /*_*/flaggedpage_config; |
| 37 | + DROP TABLE IF EXISTS /*_*/flaggedrevs_tracking; |
| 38 | + DROP TABLE IF EXISTS /*_*/flaggedrevs_promote; |
| 39 | + |
| 40 | +* If they exist, drop the columns 'page_ext_reviewed', 'page_ext_quality', 'page_ext_stable', |
| 41 | +and the index 'ext_namespace_reviewed' from the page table. You can use the following query: |
| 42 | + |
| 43 | + -- Replace /*_*/ with the proper DB prefix |
| 44 | + ALTER TABLE /*_*/page DROP INDEX ext_namespace_reviewed; |
| 45 | + ALTER TABLE /*_*/page DROP COLUMN page_ext_reviewed, DROP COLUMN page_ext_quality, DROP COLUMN page_ext_stable; |
| 46 | + |
31 | 47 | == Licensing == |
32 | 48 | © GPL, Aaron Schulz, Joerg Baach, 2007 |
33 | 49 | |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | * Is this user shown the stable version by default for this page? |
90 | 90 | * @returns bool |
91 | 91 | */ |
92 | | - public function showStableByDefaultUser() { |
| 92 | + public function isStableShownByDefaultUser() { |
93 | 93 | $this->load(); |
94 | 94 | $config = $this->article->getVisibilitySettings(); // page configuration |
95 | 95 | return ( $config['override'] && !FlaggedRevs::ignoreDefaultVersion() ); |
— | — | @@ -98,10 +98,10 @@ |
99 | 99 | * Is this user shown the diff-to-stable on edit for this page? |
100 | 100 | * @returns bool |
101 | 101 | */ |
102 | | - public function showDiffOnEditUser() { |
| 102 | + public function isDiffShownOnEdit() { |
103 | 103 | global $wgUser; |
104 | 104 | $this->load(); |
105 | | - return ( $wgUser->isAllowed('review') || $this->showStableByDefaultUser() ); |
| 105 | + return ( $wgUser->isAllowed('review') || $this->isStableShownByDefaultUser() ); |
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
— | — | @@ -400,7 +400,7 @@ |
401 | 401 | } |
402 | 402 | } |
403 | 403 | # Index the stable version only if it is the default |
404 | | - if( $this->article->showStableByDefault() ) { |
| 404 | + if( $this->article->isStableShownByDefault() ) { |
405 | 405 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
406 | 406 | } |
407 | 407 | } |
— | — | @@ -739,7 +739,7 @@ |
740 | 740 | $isOld = ($revId != $latestId); // not the current rev? |
741 | 741 | # Let new users know about review procedure a tag. |
742 | 742 | # If the log excerpt was shown this is redundant. |
743 | | - if( !$log && !$wgUser->getId() && $this->article->showStableByDefault() ) { |
| 743 | + if( !$log && !$wgUser->getId() && $this->article->isStableShownByDefault() ) { |
744 | 744 | $items[] = wfMsgExt( 'revreview-editnotice', array('parseinline') ); |
745 | 745 | } |
746 | 746 | # Add a notice if there are pending edits... |
— | — | @@ -750,7 +750,7 @@ |
751 | 751 | # Show diff to stable, to make things less confusing... |
752 | 752 | # This can be disabled via user preferences |
753 | 753 | if( $frev->getRevId() < $revId // changes were made |
754 | | - && $this->showDiffOnEditUser() // stable default and user cannot review |
| 754 | + && $this->isDiffShownOnEdit() // stable default and user cannot review |
755 | 755 | && $wgUser->getBoolOption( 'flaggedrevseditdiffs' ) // not disable via prefs |
756 | 756 | ) { |
757 | 757 | # Don't show for old revisions, diff, preview, or undo |
— | — | @@ -983,7 +983,7 @@ |
984 | 984 | // Set draft tab as needed... |
985 | 985 | if( !$skin->mTitle->isTalkPage() && !$synced ) { |
986 | 986 | if( isset( $views['edit'] ) ) { |
987 | | - if( $fa->showStableByDefault() ) { |
| 987 | + if( $fa->isStableShownByDefault() ) { |
988 | 988 | $views['edit']['text'] = wfMsg('revreview-edit'); |
989 | 989 | } |
990 | 990 | if( $this->pageOverride() ) { |
— | — | @@ -991,7 +991,7 @@ |
992 | 992 | } |
993 | 993 | } |
994 | 994 | if( isset( $views['viewsource'] ) ) { |
995 | | - if( $fa->showStableByDefault() ) { |
| 995 | + if( $fa->isStableShownByDefault() ) { |
996 | 996 | $views['viewsource']['text'] = wfMsg('revreview-source'); |
997 | 997 | } |
998 | 998 | if( $this->pageOverride() ) { |
— | — | @@ -1358,7 +1358,7 @@ |
1359 | 1359 | } else { |
1360 | 1360 | if( $frev && $latest != $frev->getRevId() ) { |
1361 | 1361 | $extraQuery .= "stable=0"; |
1362 | | - if( !$wgUser->isAllowed('review') && $this->article->showStableByDefault() ) { |
| 1362 | + if( !$wgUser->isAllowed('review') && $this->article->isStableShownByDefault() ) { |
1363 | 1363 | $extraQuery .= "&shownotice=1"; |
1364 | 1364 | } |
1365 | 1365 | } |
— | — | @@ -1487,7 +1487,7 @@ |
1488 | 1488 | $form .= Xml::closeElement( 'legend' ) . "\n"; |
1489 | 1489 | # Show explanatory text |
1490 | 1490 | if( !FlaggedRevs::lowProfileUI() ) { |
1491 | | - $msg = FlaggedRevs::showStableByDefault() ? 'revreview-text' : 'revreview-text2'; |
| 1491 | + $msg = FlaggedRevs::isStableShownByDefault() ? 'revreview-text' : 'revreview-text2'; |
1492 | 1492 | $form .= wfMsgExt( $msg, array('parse') ); |
1493 | 1493 | } |
1494 | 1494 | |