Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -1,4 +1,4 @@ |
2 | | -<? |
| 2 | +<?php |
3 | 3 | #(c) Joerg Baach, Aaron Schulz 2007 GPL |
4 | 4 | |
5 | 5 | if ( !defined( 'MEDIAWIKI' ) ) { |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | # Do flagged revs override the default view? |
71 | 71 | $wgFlaggedRevsOverride = true; |
72 | 72 | # Can users make comments that will show up below flagged revisions? |
73 | | -$wgFlaggedRevComments = true; |
| 73 | +$wgFlaggedRevComments = false; |
74 | 74 | # Make user's watch pages when reviewed if they watch pages that they edit |
75 | 75 | $wgFlaggedRevsWatch = true; |
76 | 76 | # How long to cache stable versions? (seconds) |
— | — | @@ -997,10 +997,9 @@ |
998 | 998 | } |
999 | 999 | |
1000 | 1000 | function addQuickReview( $id=NULL, $out ) { |
1001 | | - global $wgOut, $wgTitle, $wgUser, $wgFlaggedRevComments, $wgArticle, $wgRequest; |
| 1001 | + global $wgOut, $wgTitle, $wgUser, $wgFlaggedRevsOverride, $wgFlaggedRevComments, $wgFlaggedRevsWatch; |
1002 | 1002 | // Hack, we don't want two forms! |
1003 | | - if( !$id || isset($this->formCount) && $this->formCount > 0 ) return; |
1004 | | - $this->formCount = 1; |
| 1003 | + $skin = $wgUser->getSkin(); |
1005 | 1004 | // User must have review rights |
1006 | 1005 | if( !$wgUser->isAllowed( 'review' ) ) return; |
1007 | 1006 | // Already flagged? |
— | — | @@ -1010,7 +1009,10 @@ |
1011 | 1010 | $action = $reviewtitle->escapeLocalUrl( 'action=submit' ); |
1012 | 1011 | $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action ) ); |
1013 | 1012 | $form .= "<fieldset><legend>" . wfMsgHtml( 'revreview-flag', $id ) . "</legend>\n"; |
1014 | | - $form .= wfMsgExt( 'revreview-text', array('parse') ); |
| 1013 | + |
| 1014 | + if( $wgFlaggedRevsOverride ) |
| 1015 | + $form .= '<p>'.wfMsgExt( 'revreview-text', array('parseinline') ).'</p>'; |
| 1016 | + |
1015 | 1017 | $form .= wfHidden( 'title', $reviewtitle->getPrefixedText() ); |
1016 | 1018 | $form .= wfHidden( 'target', $wgTitle->getPrefixedText() ); |
1017 | 1019 | $form .= wfHidden( 'oldid', $id ); |
— | — | @@ -1039,8 +1041,8 @@ |
1040 | 1042 | "<p><textarea tabindex='1' name='wpNotes' id='wpNotes' rows='2' cols='80' style='width:100%'></textarea>" . |
1041 | 1043 | "</p>\n"; |
1042 | 1044 | } |
1043 | | - $form .= "<p>".wfInputLabel( wfMsgHtml( 'revreview-log' ), 'wpReason', 'wpReason', 60 )."\n"; |
1044 | | - $imageParams = $templateParams = ''; |
| 1045 | + |
| 1046 | + $imageParams = $templateParams = ''; |
1045 | 1047 | if( !isset($out->mTemplateIds) || !isset($out->mImageTimestamps) ) { |
1046 | 1048 | return; // something went terribly wrong... |
1047 | 1049 | } |
— | — | @@ -1058,6 +1060,14 @@ |
1059 | 1061 | } |
1060 | 1062 | $form .= Xml::hidden( 'imageParams', $imageParams ) . "\n"; |
1061 | 1063 | |
| 1064 | + $watchLabel = wfMsgExt('watchthis', array('parseinline')); |
| 1065 | + $watchAttribs = array('accesskey' => wfMsg( 'accesskey-watch' ), 'id' => 'wpWatchthis'); |
| 1066 | + $watchChecked = ( $wgFlaggedRevsWatch && $wgUser->getOption( 'watchdefault' ) || $wgTitle->userIsWatching() ); |
| 1067 | + $form .= "<p> ".Xml::check( 'wpWatchthis', $watchChecked, $watchAttribs ); |
| 1068 | + $form .= " <label for='wpWatchthis'".$skin->tooltipAndAccesskey('watch').">{$watchLabel}</label></p>"; |
| 1069 | + |
| 1070 | + $form .= "<p>".wfInputLabel( wfMsgHtml( 'revreview-log' ), 'wpReason', 'wpReason', 60 )."\n"; |
| 1071 | + |
1062 | 1072 | $form .= Xml::submitButton( wfMsgHtml( 'revreview-submit' ) ) . "</p></fieldset>"; |
1063 | 1073 | $form .= Xml::closeElement( 'form' ); |
1064 | 1074 | |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php |
— | — | @@ -220,7 +220,7 @@ |
221 | 221 | } |
222 | 222 | |
223 | 223 | function submit( $request ) { |
224 | | - global $wgOut; |
| 224 | + global $wgOut, $wgUser; |
225 | 225 | |
226 | 226 | $approved = false; |
227 | 227 | # If all values are set to zero, this has been unapproved |
— | — | @@ -247,6 +247,8 @@ |
248 | 248 | $this->approveRevision( $rev, $this->notes ) : $this->unapproveRevision( $frev ); |
249 | 249 | // Return to our page |
250 | 250 | if ( $success ) { |
| 251 | + if( $request->getCheck( 'wpWatchthis' ) ) |
| 252 | + $wgUser->addWatch( $this->page ); |
251 | 253 | $wgOut->redirect( $this->page->escapeLocalUrl() ); |
252 | 254 | } else { |
253 | 255 | $wgOut->showErrorPage( 'internalerror', 'badarticleerror' ); |
— | — | @@ -373,10 +375,6 @@ |
374 | 376 | $u = new LinksUpdate( $this->page, $poutput ); |
375 | 377 | $u->doUpdate(); // this will trigger our hook to add stable links too... |
376 | 378 | |
377 | | - // Watch it if $wgFlaggedRevsWatch is set to true and this users watches his/her edits |
378 | | - if( $wgFlaggedRevsWatch && $wgUser->getOption( 'watchdefault' ) ) |
379 | | - $wgUser->addWatch( $title ); |
380 | | - |
381 | 379 | # Clear the cache... |
382 | 380 | $this->page->invalidateCache(); |
383 | 381 | # Might as well save the cache |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | See the [[Special:Unreviewedpages]] for a list of |
54 | 54 | unreviewed pages.', |
55 | 55 | 'revreview-selected' => "Selected revision of '''$1:'''", |
56 | | - 'revreview-text' => "Approved revisions are set as the default content on page view rather than the newest |
| 56 | + 'revreview-text' => "Stable versions are set as the default content on page view rather than the newest |
57 | 57 | revision.", |
58 | 58 | 'revreview-toolow' => 'You must at least rate each of the below attributes higher than "unapproved" in order |
59 | 59 | for a revision to be considered reviewed. To depreciate a revision, set all fields to "unapproved".', |