Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -92,9 +92,9 @@ |
93 | 93 | 'revreview-draft-title' => 'This is a draft page', |
94 | 94 | 'revreview-draft-rev' => 'Draft revision', |
95 | 95 | 'revreview-edit' => 'Edit draft', |
96 | | - 'revreview-editnotice' => '\'\'\'Your changes will go into the [[{{MediaWiki:Validationpage}}|stable version]] once an authorised user reviews them.\'\'\'', |
| 96 | + 'revreview-editnotice' => '\'\'\'Your changes will be [[{{MediaWiki:Validationpage}}|published]] once an authorised user [[{{MediaWiki:Validationpage}}|reviews]] them.\'\'\'', |
97 | 97 | 'revreview-flag' => 'Review this revision', |
98 | | - 'revreview-edited' => '\'\'\'Changes will go into the [[{{MediaWiki:Validationpage}}|stable version]] once an authorised user reviews them.\'\'\' |
| 98 | + 'revreview-edited' => '\'\'\'Changes will be [[{{MediaWiki:Validationpage}}|published]] once an authorised user [[{{MediaWiki:Validationpage}}|reviews]] them.\'\'\' |
99 | 99 | The \'\'draft\'\', shown below, contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $2 suggested {{PLURAL:$2|change|changes}}].', |
100 | 100 | 'revreview-flag' => 'Review this revision', |
101 | 101 | 'revreview-unflag' => 'Unreview this revision', |
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.css |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | right: 0px; |
75 | 75 | background-repeat: no-repeat; |
76 | 76 | background-position: 0px 0px; |
77 | | - background-image: url(../FlaggedRevs/img/boxC.png); |
| 77 | + background-image: url(../../FlaggedRevs/img/boxC.png); |
78 | 78 | } |
79 | 79 | |
80 | 80 | .fr-marker-20, |
— | — | @@ -87,19 +87,19 @@ |
88 | 88 | } |
89 | 89 | |
90 | 90 | .fr-marker-20 { |
91 | | - background-image: url(../FlaggedRevs/img/bar_20.png); |
| 91 | + background-image: url(../../FlaggedRevs/img/bar_20.png); |
92 | 92 | } |
93 | 93 | .fr-marker-40 { |
94 | | - background-image: url(../FlaggedRevs/img/bar_40.png); |
| 94 | + background-image: url(../../FlaggedRevs/img/bar_40.png); |
95 | 95 | } |
96 | 96 | .fr-marker-60 { |
97 | | - background-image: url(../FlaggedRevs/img/bar_60.png); |
| 97 | + background-image: url(../../FlaggedRevs/img/bar_60.png); |
98 | 98 | } |
99 | 99 | .fr-marker-80 { |
100 | | - background-image: url(../FlaggedRevs/img/bar_80.png); |
| 100 | + background-image: url(../../FlaggedRevs/img/bar_80.png); |
101 | 101 | } |
102 | 102 | .fr-marker-100 { |
103 | | - background-image: url(../FlaggedRevs/img/bar_100.png); |
| 103 | + background-image: url(../../FlaggedRevs/img/bar_100.png); |
104 | 104 | } |
105 | 105 | |
106 | 106 | /* Short User Interface */ |
— | — | @@ -145,19 +145,19 @@ |
146 | 146 | } |
147 | 147 | |
148 | 148 | .fr-value20 { |
149 | | - background-image: url(../FlaggedRevs/img/fr-marker-20.png); |
| 149 | + background-image: url(../../FlaggedRevs/img/fr-marker-20.png); |
150 | 150 | } |
151 | 151 | .fr-value40 { |
152 | | - background-image: url(../FlaggedRevs/img/fr-marker-40.png); |
| 152 | + background-image: url(../../FlaggedRevs/img/fr-marker-40.png); |
153 | 153 | } |
154 | 154 | .fr-value60 { |
155 | | - background-image: url(../FlaggedRevs/img/fr-marker-60.png); |
| 155 | + background-image: url(../../FlaggedRevs/img/fr-marker-60.png); |
156 | 156 | } |
157 | 157 | .fr-value80 { |
158 | | - background-image: url(../FlaggedRevs/img/fr-marker-80.png); |
| 158 | + background-image: url(../../FlaggedRevs/img/fr-marker-80.png); |
159 | 159 | } |
160 | 160 | .fr-value100 { |
161 | | - background-image: url(../FlaggedRevs/img/fr-marker-100.png); |
| 161 | + background-image: url(../../FlaggedRevs/img/fr-marker-100.png); |
162 | 162 | } |
163 | 163 | |
164 | 164 | .flaggedrevs-box0, |
— | — | @@ -225,20 +225,20 @@ |
226 | 226 | background-position: center center; |
227 | 227 | } |
228 | 228 | .fr-icon-current { |
229 | | - background-image: url(../FlaggedRevs/img/1.png); |
| 229 | + background-image: url(../../FlaggedRevs/img/1.png); |
230 | 230 | } |
231 | 231 | .fr-icon-stable { |
232 | | - background-image: url(../FlaggedRevs/img/2.png); |
| 232 | + background-image: url(../../FlaggedRevs/img/2.png); |
233 | 233 | } |
234 | 234 | .fr-icon-quality { |
235 | | - background-image: url(../FlaggedRevs/img/3.png); |
| 235 | + background-image: url(../../FlaggedRevs/img/3.png); |
236 | 236 | } |
237 | 237 | .fr-icon-locked { |
238 | | - background-image: url(../FlaggedRevs/img/lock-closed.png); |
| 238 | + background-image: url(../../FlaggedRevs/img/lock-closed.png); |
239 | 239 | } |
240 | 240 | .fr-icon-unlocked { |
241 | 241 | width: 23px; |
242 | | - background-image: url(../FlaggedRevs/img/lock-open.png); |
| 242 | + background-image: url(../../FlaggedRevs/img/lock-open.png); |
243 | 243 | } |
244 | 244 | |
245 | 245 | .fr-diff-ratings { |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -155,7 +155,8 @@ |
156 | 156 | wfMsgHtml('revreview-oldrating') . |
157 | 157 | FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
158 | 158 | } |
159 | | - $tag = "<div id='mw-revisiontag-old' class='flaggedrevs_notice plainlinks noprint'>$tag</div>"; |
| 159 | + $css = 'flaggedrevs_notice plainlinks noprint'; |
| 160 | + $tag = "<div id='mw-revisiontag-old' class='$css'>$tag</div>"; |
160 | 161 | $wgOut->addHTML( $tag ); |
161 | 162 | } |
162 | 163 | return true; |
— | — | @@ -296,7 +297,8 @@ |
297 | 298 | $msg = 'revreview-quick-none'; |
298 | 299 | $tag .= "{$prot}<span class='fr-icon-current plainlinks'></span>" . |
299 | 300 | wfMsgExt($msg,array('parseinline')); |
300 | | - $tag = "<div id='mw-revisiontag' class='flaggedrevs_short{$rtl} plainlinks noprint'>$tag</div>"; |
| 301 | + $tag = "<div id='mw-revisiontag' class='flaggedrevs_short{$rtl} plainlinks noprint'>" . |
| 302 | + "$tag</div>"; |
301 | 303 | $this->reviewNotice .= $tag; |
302 | 304 | // Standard UI |
303 | 305 | } else { |
— | — | @@ -338,7 +340,8 @@ |
339 | 341 | $tooltip = wfMsgHtml('revreview-draft-title'); |
340 | 342 | $pending = "{$prot}<span class='fr-icon-current' title=\"{$tooltip}\"></span>" . |
341 | 343 | wfMsgExt('revreview-edited',array('parseinline'),$srev->getRevId(),$revsSince); |
342 | | - $pending = "<div id='mw-reviewnotice' class='flaggedrevs_preview plainlinks'>$pending</div>"; |
| 344 | + $pending = "<div id='mw-reviewnotice' class='flaggedrevs_preview plainlinks'>" . |
| 345 | + "$pending</div>"; |
343 | 346 | # Notice should always use subtitle |
344 | 347 | $this->reviewNotice = $pending; |
345 | 348 | # Construct some tagging for non-printable outputs. Note that the pending |
— | — | @@ -351,13 +354,23 @@ |
352 | 355 | // Simple icon-based UI |
353 | 356 | if( FlaggedRevs::useSimpleUI() ) { |
354 | 357 | if( $synced ) { |
355 | | - $msg = $quality ? 'revreview-quick-quality-same' : 'revreview-quick-basic-same'; |
356 | | - $class = $quality ? 'fr-icon-quality' : 'fr-icon-stable'; |
357 | | - $tooltip = $quality ? 'revreview-quality-title' : 'revreview-stable-title'; |
358 | | - $msgHTML = wfMsgExt( $msg, array('parseinline'), $srev->getRevId(), $revsSince ); |
| 358 | + $msg = $quality |
| 359 | + ? 'revreview-quick-quality-same' |
| 360 | + : 'revreview-quick-basic-same'; |
| 361 | + $class = $quality |
| 362 | + ? 'fr-icon-quality' |
| 363 | + : 'fr-icon-stable'; |
| 364 | + $tooltip = $quality |
| 365 | + ? 'revreview-quality-title' |
| 366 | + : 'revreview-stable-title'; |
| 367 | + $msgHTML = wfMsgExt( $msg, array('parseinline'), |
| 368 | + $srev->getRevId(), $revsSince ); |
359 | 369 | } else { |
360 | | - $msg = $quality ? 'revreview-quick-see-quality' : 'revreview-quick-see-basic'; |
361 | | - $msgHTML = wfMsgExt( $msg, array('parseinline'), $srev->getRevId(), $revsSince ); |
| 370 | + $msg = $quality |
| 371 | + ? 'revreview-quick-see-quality' |
| 372 | + : 'revreview-quick-see-basic'; |
| 373 | + $msgHTML = wfMsgExt( $msg, array('parseinline'), |
| 374 | + $srev->getRevId(), $revsSince ); |
362 | 375 | } |
363 | 376 | $tooltip = wfMsgHtml($tooltip); |
364 | 377 | $msgHTML = "{$prot}<span class='{$class}' title=\"{$tooltip}\"></span>$msgHTML"; |
— | — | @@ -383,7 +396,8 @@ |
384 | 397 | if( !empty($flags) ) { |
385 | 398 | $tag .= " " . FlaggedRevsXML::ratingToggle(); |
386 | 399 | $tag .= "<span id='mw-revisionratings' style='display:block;'><br />" . |
387 | | - wfMsgHtml('revreview-oldrating') . FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
| 400 | + wfMsgHtml('revreview-oldrating') . |
| 401 | + FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
388 | 402 | } |
389 | 403 | } |
390 | 404 | } |
— | — | @@ -664,7 +678,7 @@ |
665 | 679 | * Adds stable version tags to page when editing |
666 | 680 | */ |
667 | 681 | public function addToEditView( $editPage ) { |
668 | | - global $wgRequest, $wgOut; |
| 682 | + global $wgRequest, $wgOut, $wgLang, $wgUser; |
669 | 683 | $this->load(); |
670 | 684 | # Must be reviewable. UI may be limited to unobtrusive patrolling system. |
671 | 685 | if( !$this->article->isReviewable() || $this->article->limitedUI() ) |
— | — | @@ -676,8 +690,7 @@ |
677 | 691 | $quality = 0; |
678 | 692 | $frev = $this->article->getStableRev(); |
679 | 693 | if( $frev ) { |
680 | | - global $wgLang, $wgUser; |
681 | | - # Find out revision id |
| 694 | + # Find out revision id of base version |
682 | 695 | $latestId = $this->article->getLatest(); |
683 | 696 | $revId = $editPage->oldid ? $editPage->oldid : $latestId; |
684 | 697 | $isOld = ($revId != $latestId); // not the current rev? |
— | — | @@ -689,13 +702,16 @@ |
690 | 703 | # makes will be autoreviewed... |
691 | 704 | $ofrev = FlaggedRevision::newFromTitle( $this->article->getTitle(), $revId ); |
692 | 705 | if( !is_null($ofrev) ) { |
693 | | - $msg = ( $revId==$frev->getRevId() ) ? 'revreview-auto-w' : 'revreview-auto-w-old'; |
694 | | - $warning = "<div id='mw-autoreviewtag' class='flaggedrevs_warning plainlinks'>" . |
| 706 | + $msg = ( $revId==$frev->getRevId() ) ? |
| 707 | + 'revreview-auto-w' : 'revreview-auto-w-old'; |
| 708 | + $css = 'flaggedrevs_warning plainlinks'; |
| 709 | + $warning = "<div id='mw-autoreviewtag' class='$css'>" . |
695 | 710 | wfMsgExt($msg,array('parseinline')) . "</div>"; |
696 | 711 | } |
697 | 712 | # Let new users know about review procedure a tag |
698 | 713 | } elseif( !$wgUser->getId() && $this->article->showStableByDefault() ) { |
699 | | - $warning = "<div id='mw-editwarningtag' class='flaggedrevs_editnotice plainlinks'>" . |
| 714 | + $css = 'flaggedrevs_editnotice plainlinks'; |
| 715 | + $warning = "<div id='mw-editwarningtag' class='$css'>" . |
700 | 716 | wfMsgExt('revreview-editnotice',array('parseinline')) . "</div>"; |
701 | 717 | } |
702 | 718 | # Add a notice if there are pending edits... |
— | — | @@ -774,7 +790,7 @@ |
775 | 791 | $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>" ); |
776 | 792 | $wgOut->addWikiMsg( 'revreview-unlocked' ); |
777 | 793 | LogEventsList::showLogExtract( $wgOut, 'stable', |
778 | | - $this->article->getTitle()->getPrefixedText(), '', array('lim'=>1) ); |
| 794 | + $this->article->getTitle()->getPrefixedText(), '', array('lim' => 1) ); |
779 | 795 | $wgOut->addHTML( "</div>" ); |
780 | 796 | } |
781 | 797 | return true; |
— | — | @@ -799,8 +815,9 @@ |
800 | 816 | $oldreviewedLink = $wgUser->getSkin()->makeKnownLinkObj( $oldreviewed, |
801 | 817 | wfMsgHtml('oldreviewedpages'), 'category=' . urlencode($category) ); |
802 | 818 | |
803 | | - $wgOut->appendSubtitle("<span id='mw-category-oldreviewed'>$unreviewedLink / $oldreviewedLink</span>"); |
804 | | - |
| 819 | + $wgOut->appendSubtitle( |
| 820 | + "<span id='mw-category-oldreviewed'>$unreviewedLink / $oldreviewedLink</span>" |
| 821 | + ); |
805 | 822 | return true; |
806 | 823 | } |
807 | 824 | |
— | — | @@ -811,7 +828,9 @@ |
812 | 829 | global $wgRequest, $wgUser, $wgOut; |
813 | 830 | $this->load(); |
814 | 831 | # User must have review rights and page must be reviewable |
815 | | - if( !$wgUser->isAllowed('review') || !$this->article->exists() || !$this->article->isReviewable() ) { |
| 832 | + if( !$wgUser->isAllowed('review') || !$this->article->exists() |
| 833 | + || !$this->article->isReviewable() ) |
| 834 | + { |
816 | 835 | return true; |
817 | 836 | } |
818 | 837 | # Unobtrusive patrolling UI only shows forms if requested |
— | — | @@ -1005,8 +1024,10 @@ |
1006 | 1025 | $this->load(); |
1007 | 1026 | if( FlaggedRevs::allowComments() && $frev && $frev->getComment() ) { |
1008 | 1027 | $notes = "<br /><div class='flaggedrevs_notes plainlinks'>"; |
1009 | | - $notes .= wfMsgExt('revreview-note', array('parseinline'), User::whoIs( $frev->getUser() ) ); |
1010 | | - $notes .= '<br /><i>' . $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>'; |
| 1028 | + $notes .= wfMsgExt('revreview-note', array('parseinline'), |
| 1029 | + User::whoIs( $frev->getUser() ) ); |
| 1030 | + $notes .= '<br /><i>' . $wgUser->getSkin()->formatComment( $frev->getComment() ) . |
| 1031 | + '</i></div>'; |
1011 | 1032 | $this->reviewNotes = $notes; |
1012 | 1033 | } |
1013 | 1034 | } |
— | — | @@ -1115,9 +1136,11 @@ |
1116 | 1137 | // compare to current |
1117 | 1138 | $file = wfFindFile( $title ); |
1118 | 1139 | if( $file && $file->getTimestamp() > $timestamp ) |
1119 | | - $imgChanges[] = $skin->makeKnownLinkObj( $title, $title->getPrefixedText() ); |
| 1140 | + $imgChanges[] = $skin->makeKnownLinkObj( $title, |
| 1141 | + $title->getPrefixedText() ); |
1120 | 1142 | } |
1121 | | - $wgMemc->set( $key, FlaggedRevs::makeMemcObj($imgChanges), $wgParserCacheExpireTime ); |
| 1143 | + $wgMemc->set( $key, FlaggedRevs::makeMemcObj($imgChanges), |
| 1144 | + $wgParserCacheExpireTime ); |
1122 | 1145 | } |
1123 | 1146 | if( $imgChanges ) |
1124 | 1147 | $changeList += $imgChanges; |
— | — | @@ -1131,17 +1154,18 @@ |
1132 | 1155 | } |
1133 | 1156 | |
1134 | 1157 | # If the user is allowed to review, prompt them! |
| 1158 | + $css = 'flaggedrevs_diffnotice plainlinks'; |
1135 | 1159 | if( empty($changeList) && $wgUser->isAllowed('review') ) { |
1136 | | - $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" . |
| 1160 | + $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" . |
1137 | 1161 | wfMsgExt('revreview-update-none', array('parseinline')).$notice.'</div>' ); |
1138 | 1162 | } elseif( !empty($changeList) && $wgUser->isAllowed('review') ) { |
1139 | 1163 | $changeList = implode(', ',$changeList); |
1140 | | - $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" . |
| 1164 | + $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" . |
1141 | 1165 | wfMsgExt('revreview-update', array('parseinline')).' '. |
1142 | 1166 | $changeList.$notice.'</div>' ); |
1143 | 1167 | } elseif( !empty($changeList) ) { |
1144 | 1168 | $changeList = implode(', ',$changeList); |
1145 | | - $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" . |
| 1169 | + $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" . |
1146 | 1170 | wfMsgExt('revreview-update-includes', array('parseinline')).' '. |
1147 | 1171 | $changeList.$notice.'</div>' ); |
1148 | 1172 | } |
— | — | @@ -1153,13 +1177,16 @@ |
1154 | 1178 | |
1155 | 1179 | # Set a key to note that someone is viewing this |
1156 | 1180 | if( $wgUser->isAllowed('review') ) { |
1157 | | - $key = wfMemcKey( 'stableDiffs', 'underReview', $oldRev->getID(), $newRev->getID() ); |
| 1181 | + $key = wfMemcKey( 'stableDiffs', 'underReview', |
| 1182 | + $oldRev->getID(), $newRev->getID() ); |
1158 | 1183 | $wgMemc->set( $key, '1', 10*60 ); // 10 min |
1159 | 1184 | } |
1160 | 1185 | } |
1161 | 1186 | } |
1162 | 1187 | $newRevQ = FlaggedRevs::getRevQuality( $newRev->getPage(), $newRev->getId() ); |
1163 | | - $oldRevQ = $oldRev ? FlaggedRevs::getRevQuality( $newRev->getPage(), $oldRev->getId() ) : false; |
| 1188 | + $oldRevQ = $oldRev |
| 1189 | + ? FlaggedRevs::getRevQuality( $newRev->getPage(), $oldRev->getId() ) |
| 1190 | + : false; |
1164 | 1191 | # Diff between two revisions |
1165 | 1192 | if( $oldRev ) { |
1166 | 1193 | $wgOut->addHTML( "<table class='fr-diff-ratings'><tr>" ); |
— | — | @@ -1190,9 +1217,12 @@ |
1191 | 1218 | } else { |
1192 | 1219 | $msg = 'hist-draft'; |
1193 | 1220 | } |
1194 | | - $wgOut->addHTML( "<table class='fr-diff-ratings'><tr><td class='fr-$msg' align='center'>" ); |
1195 | | - $wgOut->addHTML( "<b>[" . wfMsgHtml( $msg ) . "]</b>" ); |
1196 | | - $wgOut->addHTML( '</td></tr></table>' ); |
| 1221 | + $wgOut->addHTML( |
| 1222 | + "<table class='fr-diff-ratings'>" . |
| 1223 | + "<tr><td class='fr-$msg' align='center'>" . |
| 1224 | + '<b>[' . wfMsgHtml( $msg ) . ']</b>' . |
| 1225 | + '</td></tr></table>' |
| 1226 | + ); |
1197 | 1227 | } |
1198 | 1228 | return true; |
1199 | 1229 | } |
— | — | @@ -1257,7 +1287,8 @@ |
1258 | 1288 | if( !$this->article->isReviewable() || $this->article->getTitle()->isTalkPage() ) |
1259 | 1289 | return true; |
1260 | 1290 | # We may want to skip some UI elements |
1261 | | - if( $this->article->limitedUI() ) return true; |
| 1291 | + if( $this->article->limitedUI() ) |
| 1292 | + return true; |
1262 | 1293 | # Get the stable version, from master |
1263 | 1294 | $frev = $this->article->getStableRev( FR_MASTER ); |
1264 | 1295 | if( !$frev ) |
— | — | @@ -1327,9 +1358,8 @@ |
1328 | 1359 | /** |
1329 | 1360 | * Adds a brief review form to a page. |
1330 | 1361 | * @param string $data |
1331 | | - * @param bool $top |
1332 | | - * @param bool hide |
1333 | 1362 | * @param bool $top, should this form always go on top? |
| 1363 | + * @param bool $hide |
1334 | 1364 | */ |
1335 | 1365 | public function addQuickReview( &$data, $top = false, $hide = false ) { |
1336 | 1366 | global $wgOut, $wgUser, $wgRequest; |
— | — | @@ -1538,8 +1568,11 @@ |
1539 | 1569 | if( $parserOut ) { |
1540 | 1570 | # Clear older, incomplete, cached versions |
1541 | 1571 | # We need the IDs of templates and timestamps of images used |
1542 | | - if( !isset($parserOut->fr_newestTemplateID) || !isset($parserOut->fr_newestImageTime) ) |
| 1572 | + if( !isset($parserOut->fr_newestTemplateID) |
| 1573 | + || !isset($parserOut->fr_newestImageTime) ) |
| 1574 | + { |
1543 | 1575 | $this->article->getTitle()->invalidateCache(); |
| 1576 | + } |
1544 | 1577 | } |
1545 | 1578 | return true; |
1546 | 1579 | } |