Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FRUserCounters.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Class containing utility functions for per-user stats |
5 | 5 | */ |
6 | 6 | class FRUserCounters { |
7 | | - /** |
| 7 | + /** |
8 | 8 | * Get params for a user |
9 | 9 | * @param int $uid |
10 | 10 | * @param int $flags FR_MASTER, FR_FOR_UPDATE |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | return $p; |
22 | 22 | } |
23 | 23 | |
24 | | - /** |
| 24 | + /** |
25 | 25 | * Initializes unset param fields to their starting values |
26 | 26 | * @param &array $p |
27 | 27 | */ |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | | - /** |
| 43 | + /** |
44 | 44 | * Get the params row for a user |
45 | 45 | * @param int $uid |
46 | 46 | * @param int $flags FR_MASTER, FR_FOR_UPDATE |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | ); |
64 | 64 | } |
65 | 65 | |
66 | | - /** |
| 66 | + /** |
67 | 67 | * Save params for a user |
68 | 68 | * @param int $uid |
69 | 69 | * @param array $params |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | return ( $dbw->affectedRows() > 0 ); |
82 | 82 | } |
83 | 83 | |
84 | | - /** |
| 84 | + /** |
85 | 85 | * Flatten params for a user for DB storage |
86 | 86 | * Note: param values must be integers |
87 | 87 | * @param array $params |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | return $p; |
128 | 128 | } |
129 | 129 | |
130 | | - /** |
| 130 | + /** |
131 | 131 | * Update users params array for a user on edit |
132 | 132 | * @param &array $p user params |
133 | 133 | * @param Article $article the article just edited |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | define( 'FR_INCLUDES_FREEZE', 1 ); |
53 | 53 | if ( !defined( 'FR_INCLUDES_STABLE' ) ) |
54 | 54 | define( 'FR_INCLUDES_STABLE', 2 ); |
55 | | - |
| 55 | + |
56 | 56 | $wgExtensionCredits['specialpage'][] = array( |
57 | 57 | 'path' => __FILE__, |
58 | 58 | 'name' => 'Flagged Revisions', |
— | — | @@ -623,4 +623,3 @@ |
624 | 624 | |
625 | 625 | # B/C ... |
626 | 626 | $wgLogActions['rights/erevoke'] = 'rights-editor-revoke'; |
627 | | - |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | |
79 | 79 | /** |
80 | 80 | * Is the stable version shown by default for this page? |
81 | | - * @param int $flags, FR_MASTER |
| 81 | + * @param int $flags, FR_MASTER |
82 | 82 | * @return bool |
83 | 83 | */ |
84 | 84 | public function isStableShownByDefault( $flags = 0 ) { |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | |
90 | 90 | /** |
91 | 91 | * Do edits have to be reviewed before being shown by default (going live)? |
92 | | - * @param int $flags, FR_MASTER |
| 92 | + * @param int $flags, FR_MASTER |
93 | 93 | * @return bool |
94 | 94 | */ |
95 | 95 | public function editsRequireReview( $flags = 0 ) { |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | |
103 | 103 | /** |
104 | 104 | * Are edits to this page currently pending? |
105 | | - * @param int $flags, FR_MASTER |
| 105 | + * @param int $flags, FR_MASTER |
106 | 106 | * @return bool |
107 | 107 | */ |
108 | 108 | public function revsArePending( $flags = 0 ) { |
— | — | @@ -249,27 +249,27 @@ |
250 | 250 | |
251 | 251 | /** |
252 | 252 | * Is this article reviewable? |
253 | | - * @param int $flags, FR_MASTER |
254 | | - * @return bool |
| 253 | + * @param int $flags, FR_MASTER |
| 254 | + * @return bool |
255 | 255 | */ |
256 | 256 | public function isReviewable( $flags = 0 ) { |
257 | 257 | if ( !FlaggedRevs::inReviewNamespace( $this->getTitle() ) ) { |
258 | 258 | return false; |
259 | 259 | } |
260 | | - return !( FlaggedRevs::useOnlyIfProtected() |
261 | | - && !$this->isStableShownByDefault( $flags ) ); |
| 260 | + return !( FlaggedRevs::useOnlyIfProtected() |
| 261 | + && !$this->isStableShownByDefault( $flags ) ); |
262 | 262 | } |
263 | 263 | |
264 | 264 | /** |
265 | 265 | * Is this page in patrollable? |
266 | | - * @param int $flags, FR_MASTER |
| 266 | + * @param int $flags, FR_MASTER |
267 | 267 | * @return bool |
268 | 268 | */ |
269 | 269 | public function isPatrollable( $flags = 0 ) { |
270 | | - if ( !FlaggedRevs::inPatrolNamespace( $this->getTitle() ) ) { |
| 270 | + if ( !FlaggedRevs::inPatrolNamespace( $this->getTitle() ) ) { |
271 | 271 | return false; |
272 | | - } |
273 | | - return !$this->isReviewable( $flags ); // pages that are reviewable are not patrollable |
| 272 | + } |
| 273 | + return !$this->isReviewable( $flags ); // pages that are reviewable are not patrollable |
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
— | — | @@ -283,7 +283,7 @@ |
284 | 284 | $srev = FlaggedRevision::newFromStable( $this->getTitle(), $flags ); |
285 | 285 | $this->stableRev = $srev ? $srev : false; // false => "found nothing" |
286 | 286 | } |
287 | | - if ( $this->stableRev ) { |
| 287 | + if ( $this->stableRev ) { |
288 | 288 | return $this->stableRev; |
289 | 289 | } |
290 | 290 | return null; |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -501,7 +501,7 @@ |
502 | 502 | if ( $resetManager ) { |
503 | 503 | $incManager->clear(); // reset the FRInclusionManager as needed |
504 | 504 | } |
505 | | - return $parserOut; |
| 505 | + return $parserOut; |
506 | 506 | } |
507 | 507 | |
508 | 508 | /** |
— | — | @@ -631,7 +631,7 @@ |
632 | 632 | |
633 | 633 | # ################ Tracking/cache update update functions ################# |
634 | 634 | |
635 | | - /** |
| 635 | + /** |
636 | 636 | * Update the page tables with a new stable version. |
637 | 637 | * @param Title $title |
638 | 638 | * @param mixed $sv, the new stable version (optional) |
— | — | @@ -675,7 +675,7 @@ |
676 | 676 | return $changed; |
677 | 677 | } |
678 | 678 | |
679 | | - /** |
| 679 | + /** |
680 | 680 | * @param Title $title |
681 | 681 | * Updates squid cache for a title. Defers till after main commit(). |
682 | 682 | */ |
— | — | @@ -684,7 +684,7 @@ |
685 | 685 | $wgDeferredUpdateList[] = new FRSquidUpdate( $title ); |
686 | 686 | } |
687 | 687 | |
688 | | - /** |
| 688 | + /** |
689 | 689 | * @param Article $article |
690 | 690 | * @param Revision $rev, the new stable version |
691 | 691 | * @param mixed $latest, the latest rev ID (optional) |
— | — | @@ -745,7 +745,7 @@ |
746 | 746 | return true; |
747 | 747 | } |
748 | 748 | |
749 | | - /** |
| 749 | + /** |
750 | 750 | * @param Article $article |
751 | 751 | * @param mixed $latest, the latest rev ID (optional) |
752 | 752 | * Updates the flaggedpage_pending table |
— | — | @@ -814,7 +814,7 @@ |
815 | 815 | $dbw->insert( 'flaggedpage_pending', $data, __METHOD__ ); |
816 | 816 | } |
817 | 817 | |
818 | | - /** |
| 818 | + /** |
819 | 819 | * Do cache updates for when the stable version of a page changed. |
820 | 820 | * Invalidates/purges pages that include the given page. |
821 | 821 | * @param Title $title |
— | — | @@ -830,7 +830,7 @@ |
831 | 831 | $wgDeferredUpdateList[] = new FRExtraCacheUpdate( $title ); |
832 | 832 | } |
833 | 833 | |
834 | | - /** |
| 834 | + /** |
835 | 835 | * Invalidates/purges pages where only stable version includes this page. |
836 | 836 | * @param Title $title |
837 | 837 | */ |
— | — | @@ -1249,7 +1249,7 @@ |
1250 | 1250 | return ( in_array( $ns, $namespaces ) ); |
1251 | 1251 | } |
1252 | 1252 | |
1253 | | - /** |
| 1253 | + /** |
1254 | 1254 | * Clear FlaggedRevs tracking tables for this page |
1255 | 1255 | * @param mixed $pageId (int or array) |
1256 | 1256 | */ |
— | — | @@ -1260,7 +1260,7 @@ |
1261 | 1261 | $dbw->delete( 'flaggedpage_pending', array( 'fpp_page_id' => $pageId ), __METHOD__ ); |
1262 | 1262 | } |
1263 | 1263 | |
1264 | | - /** |
| 1264 | + /** |
1265 | 1265 | * Clear tracking table of stable-only links for this page |
1266 | 1266 | * @param mixed $pageId (int or array) |
1267 | 1267 | */ |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FRExtraCacheUpdate.php |
— | — | @@ -9,15 +9,15 @@ |
10 | 10 | */ |
11 | 11 | class FRExtraCacheUpdate { |
12 | 12 | public $mTitle, $mTable; |
13 | | - public $mRowsPerJob, $mRowsPerQuery; |
| 13 | + public $mRowsPerJob, $mRowsPerQuery; |
14 | 14 | |
15 | | - public function __construct( Title $titleTo ) { |
16 | | - global $wgUpdateRowsPerJob, $wgUpdateRowsPerQuery; |
17 | | - $this->mTitle = $titleTo; |
18 | | - $this->mTable = 'flaggedrevs_tracking'; |
19 | | - $this->mRowsPerJob = $wgUpdateRowsPerJob; |
20 | | - $this->mRowsPerQuery = $wgUpdateRowsPerQuery; |
21 | | - } |
| 15 | + public function __construct( Title $titleTo ) { |
| 16 | + global $wgUpdateRowsPerJob, $wgUpdateRowsPerQuery; |
| 17 | + $this->mTitle = $titleTo; |
| 18 | + $this->mTable = 'flaggedrevs_tracking'; |
| 19 | + $this->mRowsPerJob = $wgUpdateRowsPerJob; |
| 20 | + $this->mRowsPerQuery = $wgUpdateRowsPerQuery; |
| 21 | + } |
22 | 22 | |
23 | 23 | public function doUpdate() { |
24 | 24 | # Fetch the IDs |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | $id = false; |
62 | 62 | break; |
63 | 63 | } |
64 | | - } |
| 64 | + } |
65 | 65 | # Insert batch into the queue if there is anything there |
66 | 66 | if ( $first ) { |
67 | 67 | $params = array( |
— | — | @@ -70,10 +70,10 @@ |
71 | 71 | ); |
72 | 72 | $jobs[] = new FRExtraCacheUpdateJob( $this->mTitle, $params ); |
73 | 73 | } |
74 | | - $start = $id; // Where the last ID left off |
| 74 | + $start = $id; // Where the last ID left off |
75 | 75 | } while ( $start ); |
76 | 76 | Job::batchInsert( $jobs ); |
77 | | - } |
| 77 | + } |
78 | 78 | |
79 | 79 | public function getFromField() { |
80 | 80 | return 'ftr_from'; |
— | — | @@ -85,49 +85,49 @@ |
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | | - * Invalidate a set of IDs, right now |
90 | | - */ |
91 | | - public function invalidateIDs( ResultWrapper $res ) { |
92 | | - global $wgUseFileCache, $wgUseSquid; |
93 | | - if ( $res->numRows() == 0 ) return; // sanity check |
| 89 | + * Invalidate a set of IDs, right now |
| 90 | + */ |
| 91 | + public function invalidateIDs( ResultWrapper $res ) { |
| 92 | + global $wgUseFileCache, $wgUseSquid; |
| 93 | + if ( $res->numRows() == 0 ) return; // sanity check |
94 | 94 | |
95 | | - $dbw = wfGetDB( DB_MASTER ); |
96 | | - $timestamp = $dbw->timestamp(); |
97 | | - $done = false; |
| 95 | + $dbw = wfGetDB( DB_MASTER ); |
| 96 | + $timestamp = $dbw->timestamp(); |
| 97 | + $done = false; |
98 | 98 | |
99 | | - while ( !$done ) { |
100 | | - # Get all IDs in this query into an array |
101 | | - $ids = array(); |
102 | | - for ( $i = 0; $i < $this->mRowsPerQuery; $i++ ) { |
103 | | - $row = $res->fetchRow(); |
104 | | - if ( $row ) { |
105 | | - $ids[] = $row[0]; |
106 | | - } else { |
107 | | - $done = true; |
108 | | - break; |
109 | | - } |
110 | | - } |
111 | | - if ( count( $ids ) == 0 ) break; |
112 | | - # Update page_touched |
113 | | - $dbw->update( 'page', array( 'page_touched' => $timestamp ), |
| 99 | + while ( !$done ) { |
| 100 | + # Get all IDs in this query into an array |
| 101 | + $ids = array(); |
| 102 | + for ( $i = 0; $i < $this->mRowsPerQuery; $i++ ) { |
| 103 | + $row = $res->fetchRow(); |
| 104 | + if ( $row ) { |
| 105 | + $ids[] = $row[0]; |
| 106 | + } else { |
| 107 | + $done = true; |
| 108 | + break; |
| 109 | + } |
| 110 | + } |
| 111 | + if ( count( $ids ) == 0 ) break; |
| 112 | + # Update page_touched |
| 113 | + $dbw->update( 'page', array( 'page_touched' => $timestamp ), |
114 | 114 | array( 'page_id' => $ids ), __METHOD__ ); |
115 | | - # Update static caches |
116 | | - if ( $wgUseSquid || $wgUseFileCache ) { |
117 | | - $titles = Title::newFromIDs( $ids ); |
| 115 | + # Update static caches |
| 116 | + if ( $wgUseSquid || $wgUseFileCache ) { |
| 117 | + $titles = Title::newFromIDs( $ids ); |
118 | 118 | # Update squid cache |
119 | | - if ( $wgUseSquid ) { |
120 | | - $u = SquidUpdate::newFromTitles( $titles ); |
121 | | - $u->doUpdate(); |
122 | | - } |
123 | | - # Update file cache |
124 | | - if ( $wgUseFileCache ) { |
125 | | - foreach ( $titles as $title ) { |
126 | | - HTMLFileCache::clearFileCache( $title ); |
127 | | - } |
128 | | - } |
129 | | - } |
130 | | - } |
131 | | - } |
| 119 | + if ( $wgUseSquid ) { |
| 120 | + $u = SquidUpdate::newFromTitles( $titles ); |
| 121 | + $u->doUpdate(); |
| 122 | + } |
| 123 | + # Update file cache |
| 124 | + if ( $wgUseFileCache ) { |
| 125 | + foreach ( $titles as $title ) { |
| 126 | + HTMLFileCache::clearFileCache( $title ); |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | + } |
| 131 | + } |
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedRevision.php |
— | — | @@ -23,12 +23,12 @@ |
24 | 24 | private $mTitle; |
25 | 25 | private $mPageId; |
26 | 26 | private $mRevId; |
27 | | - private $mStableTemplates; |
28 | | - private $mStableFiles; |
| 27 | + private $mStableTemplates; |
| 28 | + private $mStableFiles; |
29 | 29 | |
30 | 30 | /** |
31 | 31 | * @param mixed $row (DB row or array) |
32 | | - * @return void |
| 32 | + * @return void |
33 | 33 | */ |
34 | 34 | public function __construct( $row ) { |
35 | 35 | if ( is_object( $row ) ) { |
— | — | @@ -66,27 +66,27 @@ |
67 | 67 | # Optional fields |
68 | 68 | $this->mFlags = isset( $row['flags'] ) ? |
69 | 69 | explode( ',', $row['flags'] ) : null; |
70 | | - $this->mTemplates = isset( $row['templateVersions'] ) ? |
71 | | - $row['templateVersions'] : null; |
72 | | - $this->mFiles = isset( $row['fileVersions'] ) ? |
73 | | - $row['fileVersions'] : null; |
| 70 | + $this->mTemplates = isset( $row['templateVersions'] ) ? |
| 71 | + $row['templateVersions'] : null; |
| 72 | + $this->mFiles = isset( $row['fileVersions'] ) ? |
| 73 | + $row['fileVersions'] : null; |
74 | 74 | } else { |
75 | 75 | throw new MWException( 'FlaggedRevision constructor passed invalid row format.' ); |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | | - * Get a FlaggedRevision for a title and rev ID. |
81 | | - * Note: will return NULL if the revision is deleted. |
| 80 | + * Get a FlaggedRevision for a title and rev ID. |
| 81 | + * Note: will return NULL if the revision is deleted. |
82 | 82 | * @param Title $title |
83 | 83 | * @param int $revId |
84 | 84 | * @param int $flags FR_MASTER |
85 | 85 | * @return mixed FlaggedRevision (null on failure) |
86 | 86 | */ |
87 | 87 | public static function newFromTitle( Title $title, $revId, $flags = 0 ) { |
88 | | - if ( !FlaggedRevs::inReviewNamespace( $title ) ) { |
89 | | - return null; // short-circuit |
90 | | - } |
| 88 | + if ( !FlaggedRevs::inReviewNamespace( $title ) ) { |
| 89 | + return null; // short-circuit |
| 90 | + } |
91 | 91 | $columns = self::selectFields(); |
92 | 92 | $options = array(); |
93 | 93 | # User master/slave as appropriate |
— | — | @@ -123,16 +123,16 @@ |
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | | - * Get a FlaggedRevision of the stable version of a title. |
| 127 | + * Get a FlaggedRevision of the stable version of a title. |
128 | 128 | * @param Title $title, page title |
129 | 129 | * @param int $flags FR_MASTER |
130 | 130 | * @return mixed FlaggedRevision (null on failure) |
131 | 131 | */ |
132 | 132 | public static function newFromStable( Title $title, $flags = 0 ) { |
133 | 133 | if ( !FlaggedRevs::inReviewNamespace( $title ) ) { |
134 | | - return null; // short-circuit |
135 | | - } |
136 | | - $columns = self::selectFields(); |
| 134 | + return null; // short-circuit |
| 135 | + } |
| 136 | + $columns = self::selectFields(); |
137 | 137 | $options = array(); |
138 | 138 | $pageId = $title->getArticleID( $flags & FR_MASTER ? GAID_FOR_UPDATE : 0 ); |
139 | 139 | if ( !$pageId ) { |
— | — | @@ -165,11 +165,11 @@ |
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
169 | | - * Get a FlaggedRevision of the stable version of a title. |
| 169 | + * Get a FlaggedRevision of the stable version of a title. |
170 | 170 | * Skips tracking tables to figure out new stable version. |
171 | 171 | * @param Title $title, page title |
172 | 172 | * @param int $flags FR_MASTER |
173 | | - * @param array $config, optional page config (use to skip queries) |
| 173 | + * @param array $config, optional page config (use to skip queries) |
174 | 174 | * @param string $precedence (latest,quality,pristine) |
175 | 175 | * @return mixed FlaggedRevision (null on failure) |
176 | 176 | */ |
— | — | @@ -177,9 +177,9 @@ |
178 | 178 | Title $title, $flags = 0, $config = array(), $precedence = 'latest' |
179 | 179 | ) { |
180 | 180 | if ( !FlaggedRevs::inReviewNamespace( $title ) ) { |
181 | | - return null; // short-circuit |
182 | | - } |
183 | | - $columns = self::selectFields(); |
| 181 | + return null; // short-circuit |
| 182 | + } |
| 183 | + $columns = self::selectFields(); |
184 | 184 | $options = array(); |
185 | 185 | $pageId = $title->getArticleID( $flags & FR_FOR_UPDATE ? GAID_FOR_UPDATE : 0 ); |
186 | 186 | if ( !$pageId ) { |
— | — | @@ -193,9 +193,9 @@ |
194 | 194 | $db = wfGetDB( DB_SLAVE ); |
195 | 195 | } |
196 | 196 | # Get visiblity settings... |
197 | | - if ( empty( $config ) ) { |
198 | | - $config = FlaggedRevs::getPageVisibilitySettings( $title, $flags ); |
199 | | - } |
| 197 | + if ( empty( $config ) ) { |
| 198 | + $config = FlaggedRevs::getPageVisibilitySettings( $title, $flags ); |
| 199 | + } |
200 | 200 | if ( !$config['override'] && FlaggedRevs::useOnlyIfProtected() ) { |
201 | 201 | return null; // page is not reviewable; no stable version |
202 | 202 | } |
— | — | @@ -268,13 +268,13 @@ |
269 | 269 | * @return bool success |
270 | 270 | */ |
271 | 271 | public function insertOn( $auto = false ) { |
272 | | - $dbw = wfGetDB( DB_MASTER ); |
273 | | - # Set any text flags |
274 | | - $textFlags = 'dynamic'; |
| 272 | + $dbw = wfGetDB( DB_MASTER ); |
| 273 | + # Set any text flags |
| 274 | + $textFlags = 'dynamic'; |
275 | 275 | if ( $auto ) $textFlags .= ',auto'; |
276 | 276 | $this->mFlags = explode( ',', $textFlags ); |
277 | | - # Build the inclusion data chunks |
278 | | - $tmpInsertRows = array(); |
| 277 | + # Build the inclusion data chunks |
| 278 | + $tmpInsertRows = array(); |
279 | 279 | foreach ( $this->getTemplateVersions() as $namespace => $titleAndID ) { |
280 | 280 | foreach ( $titleAndID as $dbkey => $id ) { |
281 | 281 | $tmpInsertRows[] = array( |
— | — | @@ -315,14 +315,14 @@ |
316 | 316 | array( array( 'fr_page_id', 'fr_rev_id' ) ), $revRow, __METHOD__ ); |
317 | 317 | # Clear out any previous garbage... |
318 | 318 | $dbw->delete( 'flaggedtemplates', |
319 | | - array( 'ft_rev_id' => $this->getRevId() ), __METHOD__ ); |
| 319 | + array( 'ft_rev_id' => $this->getRevId() ), __METHOD__ ); |
320 | 320 | # ...and insert template version data |
321 | 321 | if ( $tmpInsertRows ) { |
322 | 322 | $dbw->insert( 'flaggedtemplates', $tmpInsertRows, __METHOD__, 'IGNORE' ); |
323 | 323 | } |
324 | 324 | # Clear out any previous garbage... |
325 | 325 | $dbw->delete( 'flaggedimages', |
326 | | - array( 'fi_rev_id' => $this->getRevId() ), __METHOD__ ); |
| 326 | + array( 'fi_rev_id' => $this->getRevId() ), __METHOD__ ); |
327 | 327 | # ...and insert file version data |
328 | 328 | if ( $fileInsertRows ) { |
329 | 329 | $dbw->insert( 'flaggedimages', $fileInsertRows, __METHOD__, 'IGNORE' ); |
— | — | @@ -336,7 +336,7 @@ |
337 | 337 | protected static function selectFields() { |
338 | 338 | return array( |
339 | 339 | 'fr_rev_id', 'fr_page_id', 'fr_user', 'fr_timestamp', |
340 | | - 'fr_comment', 'fr_quality', 'fr_tags', 'fr_img_name', |
| 340 | + 'fr_comment', 'fr_quality', 'fr_tags', 'fr_img_name', |
341 | 341 | 'fr_img_sha1', 'fr_img_timestamp', 'fr_flags' |
342 | 342 | ); |
343 | 343 | } |
— | — | @@ -460,7 +460,7 @@ |
461 | 461 | } |
462 | 462 | |
463 | 463 | /** |
464 | | - * @param User $user |
| 464 | + * @param User $user |
465 | 465 | * @return bool |
466 | 466 | */ |
467 | 467 | public function userCanSetFlags( $user ) { |
— | — | @@ -471,7 +471,7 @@ |
472 | 472 | * Get original template versions at time of review |
473 | 473 | * @param int $flags FR_MASTER |
474 | 474 | * @return Array template versions (ns -> dbKey -> rev Id) |
475 | | - * Note: 0 used for template rev Id if it didn't exist |
| 475 | + * Note: 0 used for template rev Id if it didn't exist |
476 | 476 | */ |
477 | 477 | public function getTemplateVersions( $flags = 0 ) { |
478 | 478 | if ( $this->mTemplates == null ) { |
— | — | @@ -479,7 +479,7 @@ |
480 | 480 | $db = ( $flags & FR_MASTER ) ? |
481 | 481 | wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
482 | 482 | $res = $db->select( 'flaggedtemplates', |
483 | | - array( 'ft_namespace', 'ft_title', 'ft_tmp_rev_id' ), |
| 483 | + array( 'ft_namespace', 'ft_title', 'ft_tmp_rev_id' ), |
484 | 484 | array( 'ft_rev_id' => $this->getRevId() ), |
485 | 485 | __METHOD__ |
486 | 486 | ); |
— | — | @@ -497,7 +497,7 @@ |
498 | 498 | * Get original template versions at time of review |
499 | 499 | * @param int $flags FR_MASTER |
500 | 500 | * @return Array file versions (dbKey => array('ts' => MW timestamp,'sha1' => sha1) ) |
501 | | - * Note: '0' used for file timestamp if it didn't exist ('' for sha1) |
| 501 | + * Note: '0' used for file timestamp if it didn't exist ('' for sha1) |
502 | 502 | */ |
503 | 503 | public function getFileVersions( $flags = 0 ) { |
504 | 504 | if ( $this->mFiles == null ) { |
— | — | @@ -505,16 +505,16 @@ |
506 | 506 | $db = ( $flags & FR_MASTER ) ? |
507 | 507 | wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
508 | 508 | $res = $db->select( 'flaggedimages', |
509 | | - array( 'fi_name', 'fi_img_timestamp', 'fi_img_sha1' ), |
| 509 | + array( 'fi_name', 'fi_img_timestamp', 'fi_img_sha1' ), |
510 | 510 | array( 'fi_rev_id' => $this->getRevId() ), |
511 | 511 | __METHOD__ |
512 | 512 | ); |
513 | 513 | foreach ( $res as $row ) { |
514 | | - $reviewedTS = trim( $row->fi_img_timestamp ); // may be ''/NULL |
515 | | - $reviewedTS = $reviewedTS ? wfTimestamp( TS_MW, $reviewedTS ) : '0'; |
| 514 | + $reviewedTS = trim( $row->fi_img_timestamp ); // may be ''/NULL |
| 515 | + $reviewedTS = $reviewedTS ? wfTimestamp( TS_MW, $reviewedTS ) : '0'; |
516 | 516 | $this->mFiles[$row->fi_name] = array(); |
517 | | - $this->mFiles[$row->fi_name]['ts'] = $reviewedTS; |
518 | | - $this->mFiles[$row->fi_name]['sha1'] = $row->fi_img_sha1; |
| 517 | + $this->mFiles[$row->fi_name]['ts'] = $reviewedTS; |
| 518 | + $this->mFiles[$row->fi_name]['sha1'] = $row->fi_img_sha1; |
519 | 519 | } |
520 | 520 | } |
521 | 521 | return $this->mFiles; |
— | — | @@ -524,7 +524,7 @@ |
525 | 525 | * Get the current stable version of the templates used at time of review |
526 | 526 | * @param int $flags FR_MASTER |
527 | 527 | * @return Array template versions (ns -> dbKey -> rev Id) |
528 | | - * Note: 0 used for template rev Id if it doesn't exist |
| 528 | + * Note: 0 used for template rev Id if it doesn't exist |
529 | 529 | */ |
530 | 530 | public function getStableTemplateVersions( $flags = 0 ) { |
531 | 531 | if ( $this->mStableTemplates == null ) { |
— | — | @@ -532,22 +532,22 @@ |
533 | 533 | $db = ( $flags & FR_MASTER ) ? |
534 | 534 | wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
535 | 535 | $res = $db->select( |
536 | | - array( 'flaggedtemplates', 'page', 'flaggedpages' ), |
537 | | - array( 'ft_namespace', 'ft_title', 'fp_stable' ), |
| 536 | + array( 'flaggedtemplates', 'page', 'flaggedpages' ), |
| 537 | + array( 'ft_namespace', 'ft_title', 'fp_stable' ), |
538 | 538 | array( 'ft_rev_id' => $this->getRevId() ), |
539 | 539 | __METHOD__, |
540 | | - array(), |
541 | | - array( |
542 | | - 'page' => array( 'LEFT JOIN', |
543 | | - 'page_namespace = ft_namespace AND page_title = ft_title'), |
544 | | - 'flaggedpages' => array( 'LEFT JOIN', 'fp_page_id = page_id' ) |
545 | | - ) |
| 540 | + array(), |
| 541 | + array( |
| 542 | + 'page' => array( 'LEFT JOIN', |
| 543 | + 'page_namespace = ft_namespace AND page_title = ft_title'), |
| 544 | + 'flaggedpages' => array( 'LEFT JOIN', 'fp_page_id = page_id' ) |
| 545 | + ) |
546 | 546 | ); |
547 | 547 | foreach ( $res as $row ) { |
548 | 548 | if ( !isset( $this->mStableTemplates[$row->ft_namespace] ) ) { |
549 | 549 | $this->mStableTemplates[$row->ft_namespace] = array(); |
550 | 550 | } |
551 | | - $revId = (int)$row->fp_stable; // 0 => none |
| 551 | + $revId = (int)$row->fp_stable; // 0 => none |
552 | 552 | $this->mStableTemplates[$row->ft_namespace][$row->ft_title] = $revId; |
553 | 553 | } |
554 | 554 | } |
— | — | @@ -558,7 +558,7 @@ |
559 | 559 | * Get the current stable version of the files used at time of review |
560 | 560 | * @param int $flags FR_MASTER |
561 | 561 | * @return Array file versions (dbKey => array('ts' => MW timestamp,'sha1' => sha1) ) |
562 | | - * Note: '0' used for file timestamp if it doesn't exist ('' for sha1) |
| 562 | + * Note: '0' used for file timestamp if it doesn't exist ('' for sha1) |
563 | 563 | */ |
564 | 564 | public function getStableFileVersions( $flags = 0 ) { |
565 | 565 | if ( $this->mStableFiles == null ) { |
— | — | @@ -577,7 +577,7 @@ |
578 | 578 | 'flaggedpages' => array( 'LEFT JOIN', 'fp_page_id = page_id' ), |
579 | 579 | 'flaggedrevs' => array( 'LEFT JOIN', |
580 | 580 | 'fr_page_id = fp_page_id AND fr_rev_id = fp_stable' ) |
581 | | - ) |
| 581 | + ) |
582 | 582 | ); |
583 | 583 | foreach ( $res as $row ) { |
584 | 584 | $reviewedTS = '0'; |
— | — | @@ -613,13 +613,13 @@ |
614 | 614 | return array(); // short-circuit |
615 | 615 | } |
616 | 616 | $dbr = wfGetDB( DB_SLAVE ); |
617 | | - # Only get templates with stable or "review time" versions. |
618 | | - # Note: ft_tmp_rev_id is nullable (for deadlinks), so use ft_title |
619 | | - if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) { |
620 | | - $reviewed = "ft_title IS NOT NULL OR fp_stable IS NOT NULL"; |
621 | | - } else { |
622 | | - $reviewed = "ft_title IS NOT NULL"; |
623 | | - } |
| 617 | + # Only get templates with stable or "review time" versions. |
| 618 | + # Note: ft_tmp_rev_id is nullable (for deadlinks), so use ft_title |
| 619 | + if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) { |
| 620 | + $reviewed = "ft_title IS NOT NULL OR fp_stable IS NOT NULL"; |
| 621 | + } else { |
| 622 | + $reviewed = "ft_title IS NOT NULL"; |
| 623 | + } |
624 | 624 | $ret = $dbr->select( |
625 | 625 | array( 'templatelinks', 'flaggedtemplates', 'page', 'flaggedpages' ), |
626 | 626 | array( 'tl_namespace', 'tl_title', 'fp_stable', 'ft_tmp_rev_id', 'page_latest' ), |
— | — | @@ -665,7 +665,7 @@ |
666 | 666 | |
667 | 667 | /* |
668 | 668 | * Fetch pending file changes for this reviewed page version. |
669 | | - * For each file, the "version used" (for stable parsing) is: |
| 669 | + * For each file, the "version used" (for stable parsing) is: |
670 | 670 | * (a) (the latest rev) if FR_INCLUDES_CURRENT. Might be non-existing. |
671 | 671 | * (b) newest( stable rev, rev at time of review ) if FR_INCLUDES_STABLE |
672 | 672 | * (c) ( rev at time of review ) if FR_INCLUDES_FREEZE |
— | — | @@ -683,13 +683,13 @@ |
684 | 684 | return array(); // short-circuit |
685 | 685 | } |
686 | 686 | $dbr = wfGetDB( DB_SLAVE ); |
687 | | - # Only get templates with stable or "review time" versions. |
688 | | - # Note: fi_img_timestamp is nullable (for deadlinks), so use fi_name |
689 | | - if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) { |
690 | | - $reviewed = "fi_name IS NOT NULL OR fr_img_timestamp IS NOT NULL"; |
691 | | - } else { |
692 | | - $reviewed = "fi_name IS NOT NULL"; |
693 | | - } |
| 687 | + # Only get templates with stable or "review time" versions. |
| 688 | + # Note: fi_img_timestamp is nullable (for deadlinks), so use fi_name |
| 689 | + if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) { |
| 690 | + $reviewed = "fi_name IS NOT NULL OR fr_img_timestamp IS NOT NULL"; |
| 691 | + } else { |
| 692 | + $reviewed = "fi_name IS NOT NULL"; |
| 693 | + } |
694 | 694 | $ret = $dbr->select( |
695 | 695 | array( 'imagelinks', 'flaggedimages', 'page', 'flaggedpages', 'flaggedrevs' ), |
696 | 696 | array( 'il_to', 'fi_img_timestamp', 'fr_img_timestamp' ), |
— | — | @@ -704,34 +704,34 @@ |
705 | 705 | 'flaggedpages' => array( 'LEFT JOIN', 'fp_page_id = page_id' ), |
706 | 706 | 'flaggedrevs' => array( 'LEFT JOIN', |
707 | 707 | 'fr_page_id = fp_page_id AND fr_rev_id = fp_stable' ) |
708 | | - ) |
| 708 | + ) |
709 | 709 | ); |
710 | 710 | $fileChanges = array(); |
711 | 711 | foreach ( $ret as $row ) { |
712 | 712 | $title = Title::makeTitleSafe( NS_FILE, $row->il_to ); |
713 | 713 | $reviewedTS = trim( $row->fi_img_timestamp ); // may be ''/NULL |
714 | | - $reviewedTS = $reviewedTS ? wfTimestamp( TS_MW, $reviewedTS ) : null; |
| 714 | + $reviewedTS = $reviewedTS ? wfTimestamp( TS_MW, $reviewedTS ) : null; |
715 | 715 | if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) { |
716 | 716 | $stableTS = wfTimestampOrNull( TS_MW, $row->fr_img_timestamp ); |
717 | | - # Select newest of (stable rev, rev when reviewed) as "version used" |
| 717 | + # Select newest of (stable rev, rev when reviewed) as "version used" |
718 | 718 | $tsStable = ( $stableTS >= $reviewedTS ) |
719 | | - ? $stableTS |
720 | | - : $reviewedTS; |
| 719 | + ? $stableTS |
| 720 | + : $reviewedTS; |
721 | 721 | } else { |
722 | 722 | $tsStable = $reviewedTS; |
723 | 723 | } |
724 | 724 | # Compare to current... |
725 | 725 | $file = wfFindFile( $title ); // current file version |
726 | 726 | if ( $file ) { // file exists |
727 | | - if ( $noForeign === 'noForeign' && !$file->isLocal() ) { |
728 | | - $updated = !$tsStable; // created (ignore new versions) |
729 | | - } else { |
730 | | - $updated = ( $file->getTimestamp() > $tsStable ); // edited/created |
731 | | - } |
732 | | - $deleted = false; |
| 727 | + if ( $noForeign === 'noForeign' && !$file->isLocal() ) { |
| 728 | + $updated = !$tsStable; // created (ignore new versions) |
| 729 | + } else { |
| 730 | + $updated = ( $file->getTimestamp() > $tsStable ); // edited/created |
| 731 | + } |
| 732 | + $deleted = false; |
733 | 733 | } else { // file doesn't exists |
734 | 734 | $updated = false; |
735 | | - $deleted = (bool)$tsStable; // later deleted |
| 735 | + $deleted = (bool)$tsStable; // later deleted |
736 | 736 | } |
737 | 737 | if ( $deleted || $updated ) { |
738 | 738 | $fileChanges[] = array( $title, $tsStable ); |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FRDependencyUpdate.php |
— | — | @@ -11,14 +11,14 @@ |
12 | 12 | protected $sCategories; |
13 | 13 | protected $dbw; |
14 | 14 | |
15 | | - public function __construct( Title $title, ParserOutput $stableOutput ) { |
| 15 | + public function __construct( Title $title, ParserOutput $stableOutput ) { |
16 | 16 | $this->title = $title; |
17 | 17 | # Stable version links |
18 | 18 | $this->sLinks = $stableOutput->getLinks(); |
19 | 19 | $this->sTemplates = $stableOutput->getTemplates(); |
20 | 20 | $this->sImages = $stableOutput->getImages(); |
21 | 21 | $this->sCategories = $stableOutput->getCategories(); |
22 | | - } |
| 22 | + } |
23 | 23 | |
24 | 24 | public function doUpdate() { |
25 | 25 | $deps = array(); |
— | — | @@ -50,10 +50,10 @@ |
51 | 51 | # Get any categories that are only in the stable version... |
52 | 52 | $cCategories = $this->getCurrentVersionCategories(); |
53 | 53 | foreach ( $this->sCategories as $category => $sort ) { |
54 | | - if ( !isset( $cCategories[$category] ) ) { |
| 54 | + if ( !isset( $cCategories[$category] ) ) { |
55 | 55 | self::addDependency( $deps, NS_CATEGORY, $category ); |
56 | 56 | } |
57 | | - } |
| 57 | + } |
58 | 58 | # Get any dependency tracking changes |
59 | 59 | $existing = $this->getExistingDeps(); |
60 | 60 | # Do incremental updates... |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/specialpages/Stabilization_body.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | global $wgUser; |
16 | 16 | parent::__construct( 'Stabilization', 'stablesettings' ); |
17 | 17 | $this->skin = $wgUser->getSkin(); |
18 | | - } |
| 18 | + } |
19 | 19 | |
20 | 20 | public function execute( $par ) { |
21 | 21 | global $wgRequest, $wgUser, $wgOut; |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/specialpages/RevisionReview_body.php |
— | — | @@ -11,12 +11,12 @@ |
12 | 12 | private $form; |
13 | 13 | private $page; |
14 | 14 | |
15 | | - public function __construct() { |
| 15 | + public function __construct() { |
16 | 16 | parent::__construct( 'RevisionReview', 'review' ); |
17 | | - } |
| 17 | + } |
18 | 18 | |
19 | | - public function execute( $par ) { |
20 | | - global $wgRequest, $wgUser, $wgOut; |
| 19 | + public function execute( $par ) { |
| 20 | + global $wgRequest, $wgUser, $wgOut; |
21 | 21 | $confirmed = $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ); |
22 | 22 | if ( $wgUser->isAllowed( 'review' ) ) { |
23 | 23 | if ( $wgUser->isBlocked( !$confirmed ) ) { |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/specialpages/QualityOversight_body.php |
— | — | @@ -6,11 +6,11 @@ |
7 | 7 | |
8 | 8 | class QualityOversight extends SpecialPage |
9 | 9 | { |
10 | | - public function __construct() { |
11 | | - parent::__construct( 'QualityOversight' ); |
12 | | - } |
| 10 | + public function __construct() { |
| 11 | + parent::__construct( 'QualityOversight' ); |
| 12 | + } |
13 | 13 | |
14 | | - public function execute( $par ) { |
| 14 | + public function execute( $par ) { |
15 | 15 | global $wgOut, $wgUser, $wgRequest, $wgFlaggedRevsOversightAge; |
16 | 16 | |
17 | 17 | $this->setHeaders(); |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php |
— | — | @@ -6,12 +6,12 @@ |
7 | 7 | |
8 | 8 | class ReviewedVersions extends UnlistedSpecialPage |
9 | 9 | { |
10 | | - public function __construct() { |
11 | | - parent::__construct( 'ReviewedVersions' ); |
12 | | - } |
| 10 | + public function __construct() { |
| 11 | + parent::__construct( 'ReviewedVersions' ); |
| 12 | + } |
13 | 13 | |
14 | | - public function execute( $par ) { |
15 | | - global $wgRequest, $wgUser, $wgOut; |
| 14 | + public function execute( $par ) { |
| 15 | + global $wgRequest, $wgUser, $wgOut; |
16 | 16 | |
17 | 17 | $this->setHeaders(); |
18 | 18 | $this->skin = $wgUser->getSkin(); |
— | — | @@ -59,8 +59,8 @@ |
60 | 60 | $ftime = $wgLang->time( wfTimestamp( TS_MW, $row->fr_timestamp ), true ); |
61 | 61 | $review = wfMsgExt( 'reviewedversions-review', array( 'parseinline', 'replaceafter' ), |
62 | 62 | $fdatim, |
63 | | - $this->skin->userLink( $row->fr_user, $row->user_name ) . |
64 | | - ' ' . $this->skin->userToolLinks( $row->fr_user, $row->user_name ), |
| 63 | + $this->skin->userLink( $row->fr_user, $row->user_name ) . |
| 64 | + ' ' . $this->skin->userToolLinks( $row->fr_user, $row->user_name ), |
65 | 65 | $fdate, $ftime, $row->user_name |
66 | 66 | ); |
67 | 67 | $lev = ( $row->fr_quality >= 1 ) |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php |
— | — | @@ -8,11 +8,11 @@ |
9 | 9 | class ConfiguredPages extends SpecialPage |
10 | 10 | { |
11 | 11 | public function __construct() { |
12 | | - parent::__construct( 'ConfiguredPages' ); |
13 | | - } |
| 12 | + parent::__construct( 'ConfiguredPages' ); |
| 13 | + } |
14 | 14 | |
15 | 15 | public function execute( $par ) { |
16 | | - global $wgRequest, $wgUser; |
| 16 | + global $wgRequest, $wgUser; |
17 | 17 | |
18 | 18 | $this->setHeaders(); |
19 | 19 | $this->skin = $wgUser->getSkin(); |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | { |
10 | 10 | public function __construct() { |
11 | 11 | parent::__construct( 'ReviewedPages' ); |
12 | | - } |
| 12 | + } |
13 | 13 | |
14 | 14 | public function execute( $par ) { |
15 | 15 | global $wgRequest, $wgUser; |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/specialpages/StablePages_body.php |
— | — | @@ -8,11 +8,11 @@ |
9 | 9 | class StablePages extends SpecialPage |
10 | 10 | { |
11 | 11 | public function __construct() { |
12 | | - parent::__construct( 'StablePages' ); |
13 | | - } |
| 12 | + parent::__construct( 'StablePages' ); |
| 13 | + } |
14 | 14 | |
15 | 15 | public function execute( $par ) { |
16 | | - global $wgRequest, $wgUser; |
| 16 | + global $wgRequest, $wgUser; |
17 | 17 | |
18 | 18 | $this->setHeaders(); |
19 | 19 | $this->skin = $wgUser->getSkin(); |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -177,23 +177,23 @@ |
178 | 178 | * @returns string |
179 | 179 | * Generates a review box/tag |
180 | 180 | */ |
181 | | - public static function addTagRatings( $flags, $prettyBox = false, $css = '' ) { |
182 | | - $tag = ''; |
183 | | - if ( $prettyBox ) { |
184 | | - $tag .= "<table id='mw-fr-revisionratings-box' align='center' class='$css' cellpadding='0'>"; |
| 181 | + public static function addTagRatings( $flags, $prettyBox = false, $css = '' ) { |
| 182 | + $tag = ''; |
| 183 | + if ( $prettyBox ) { |
| 184 | + $tag .= "<table id='mw-fr-revisionratings-box' align='center' class='$css' cellpadding='0'>"; |
185 | 185 | } |
186 | 186 | foreach ( FlaggedRevs::getTags() as $quality ) { |
187 | 187 | $level = isset( $flags[$quality] ) ? $flags[$quality] : 0; |
188 | 188 | $encValueText = wfMsgHtml( "revreview-$quality-$level" ); |
189 | | - $level = $flags[$quality]; |
| 189 | + $level = $flags[$quality]; |
190 | 190 | |
191 | | - $levelmarker = $level * 20 + 20; |
192 | | - if ( $prettyBox ) { |
193 | | - $tag .= "<tr><td class='fr-text' valign='middle'>" . |
| 191 | + $levelmarker = $level * 20 + 20; |
| 192 | + if ( $prettyBox ) { |
| 193 | + $tag .= "<tr><td class='fr-text' valign='middle'>" . |
194 | 194 | wfMsgHtml( "revreview-$quality" ) . |
195 | 195 | "</td><td class='fr-value$levelmarker' valign='middle'>" . |
196 | 196 | $encValueText . "</td></tr>\n"; |
197 | | - } else { |
| 197 | + } else { |
198 | 198 | $tag .= " <span class='fr-marker-$levelmarker'><strong>" . |
199 | 199 | wfMsgHtml( "revreview-$quality" ) . |
200 | 200 | "</strong>: <span class='fr-text-value'>$encValueText </span> " . |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | $tag .= '</table>'; |
206 | 206 | } |
207 | 207 | return $tag; |
208 | | - } |
| 208 | + } |
209 | 209 | |
210 | 210 | /** |
211 | 211 | * @param FlaggedRevision $frev, the reviewed version |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | } else { |
235 | 235 | $color = 'flaggedrevs-color-1'; |
236 | 236 | } |
237 | | - # Construct some tagging |
| 237 | + # Construct some tagging |
238 | 238 | if ( $synced && ( $type == 'stable' || $type == 'draft' ) ) { |
239 | 239 | $msg = $quality ? |
240 | 240 | 'revreview-quality-same' : 'revreview-basic-same'; |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | } |
281 | 281 | $box .= Xml::closeElement( 'div' ) . "\n"; |
282 | 282 | $box .= "</div>\n"; |
283 | | - return $box; |
| 283 | + return $box; |
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1347,7 +1347,7 @@ |
1348 | 1348 | return true; |
1349 | 1349 | } |
1350 | 1350 | |
1351 | | - /** |
| 1351 | + /** |
1352 | 1352 | * Record demotion so that auto-promote will be disabled |
1353 | 1353 | */ |
1354 | 1354 | public static function recordDemote( $user, array $addgroup, array $removegroup ) { |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | // set to override given the relevant conditions (like &stable=0) or there |
303 | 303 | // is no stable version. |
304 | 304 | } else { |
305 | | - $this->showDraftVersion( $srev, $tag, $prot ); |
| 305 | + $this->showDraftVersion( $srev, $tag, $prot ); |
306 | 306 | } |
307 | 307 | $encJS = ''; // JS events to use |
308 | 308 | # Some checks for which tag CSS to use |
— | — | @@ -1135,20 +1135,20 @@ |
1136 | 1136 | // XXX: shouldn't the session slave position check handle this? |
1137 | 1137 | $flags = ( $action == 'rollback' ) ? FR_MASTER : 0; |
1138 | 1138 | $srev = $this->article->getStableRev( $flags ); |
1139 | | - if ( !$srev ) { |
| 1139 | + if ( !$srev ) { |
1140 | 1140 | return true; // No stable revision exists |
1141 | 1141 | } |
1142 | 1142 | $synced = $this->article->stableVersionIsSynced(); |
1143 | 1143 | $pendingEdits = !$synced && $this->article->isStableShownByDefault(); |
1144 | 1144 | // Set the edit tab names as needed... |
1145 | | - if ( $pendingEdits ) { |
1146 | | - if ( isset( $views['edit'] ) ) { |
| 1145 | + if ( $pendingEdits ) { |
| 1146 | + if ( isset( $views['edit'] ) ) { |
1147 | 1147 | $views['edit']['text'] = wfMsg( 'revreview-edit' ); |
1148 | | - } |
1149 | | - if ( isset( $views['viewsource'] ) ) { |
| 1148 | + } |
| 1149 | + if ( isset( $views['viewsource'] ) ) { |
1150 | 1150 | $views['viewsource']['text'] = wfMsg( 'revreview-source' ); |
1151 | 1151 | } |
1152 | | - } |
| 1152 | + } |
1153 | 1153 | # Add "pending changes" tab if the page is not synced |
1154 | 1154 | if ( !$synced ) { |
1155 | 1155 | $this->addDraftTab( $views, $srev, $action, $type ); |
— | — | @@ -1162,18 +1162,18 @@ |
1163 | 1163 | ) { |
1164 | 1164 | global $wgRequest, $wgOut; |
1165 | 1165 | $title = $this->article->getTitle(); // convenience |
1166 | | - $tabs = array( |
1167 | | - 'read' => array( // view stable |
| 1166 | + $tabs = array( |
| 1167 | + 'read' => array( // view stable |
1168 | 1168 | 'text' => '', // unused |
1169 | 1169 | 'href' => $title->getLocalUrl( 'stable=1' ), |
1170 | | - 'class' => '' |
1171 | | - ), |
1172 | | - 'draft' => array( // view draft |
| 1170 | + 'class' => '' |
| 1171 | + ), |
| 1172 | + 'draft' => array( // view draft |
1173 | 1173 | 'text' => wfMsg( 'revreview-current' ), |
1174 | 1174 | 'href' => $title->getLocalUrl( 'stable=0&redirect=no' ), |
1175 | | - 'class' => 'collapsible' |
1176 | | - ), |
1177 | | - ); |
| 1175 | + 'class' => 'collapsible' |
| 1176 | + ), |
| 1177 | + ); |
1178 | 1178 | // Set tab selection CSS |
1179 | 1179 | if ( $this->pageOverride() || $wgRequest->getVal( 'stableid' ) ) { |
1180 | 1180 | // We are looking a the stable version or an old reviewed one |
— | — | @@ -1236,8 +1236,8 @@ |
1237 | 1237 | } |
1238 | 1238 | } |
1239 | 1239 | } |
1240 | | - // Replaces old tabs with new tabs |
1241 | | - $views = $newViews; |
| 1240 | + // Replaces old tabs with new tabs |
| 1241 | + $views = $newViews; |
1242 | 1242 | } |
1243 | 1243 | |
1244 | 1244 | /** |
— | — | @@ -1560,7 +1560,7 @@ |
1561 | 1561 | && $oldRev->getPage() == $newRev->getPage() // no multipage diffs |
1562 | 1562 | && $oldRev->getId() == $srev->getRevId() |
1563 | 1563 | && $newRev->getTimestamp() >= $oldRev->getTimestamp() // no backwards diffs |
1564 | | - ); |
| 1564 | + ); |
1565 | 1565 | } |
1566 | 1566 | |
1567 | 1567 | /** |
Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedArticleView.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1568 | 1568 | Merged /trunk/extensions/FlaggedRevs/FlaggedArticleView.php:r78514 |
Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1569 | 1569 | Merged /trunk/extensions/FlaggedRevs:r78514 |