r22755 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22754‎ | r22755 | r22756 >
Date:12:20, 5 June 2007
Author:aaron
Status:old
Tags:
Comment:
*Expand php tags, clean up watch checkbox, disable comments by default
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -1,4 +1,4 @@
2 -<?
 2+<?php
33 #(c) Joerg Baach, Aaron Schulz 2007 GPL
44
55 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -69,7 +69,7 @@
7070 # Do flagged revs override the default view?
7171 $wgFlaggedRevsOverride = true;
7272 # Can users make comments that will show up below flagged revisions?
73 -$wgFlaggedRevComments = true;
 73+$wgFlaggedRevComments = false;
7474 # Make user's watch pages when reviewed if they watch pages that they edit
7575 $wgFlaggedRevsWatch = true;
7676 # How long to cache stable versions? (seconds)
@@ -997,10 +997,9 @@
998998 }
999999
10001000 function addQuickReview( $id=NULL, $out ) {
1001 - global $wgOut, $wgTitle, $wgUser, $wgFlaggedRevComments, $wgArticle, $wgRequest;
 1001+ global $wgOut, $wgTitle, $wgUser, $wgFlaggedRevsOverride, $wgFlaggedRevComments, $wgFlaggedRevsWatch;
10021002 // 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();
10051004 // User must have review rights
10061005 if( !$wgUser->isAllowed( 'review' ) ) return;
10071006 // Already flagged?
@@ -1010,7 +1009,10 @@
10111010 $action = $reviewtitle->escapeLocalUrl( 'action=submit' );
10121011 $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action ) );
10131012 $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+
10151017 $form .= wfHidden( 'title', $reviewtitle->getPrefixedText() );
10161018 $form .= wfHidden( 'target', $wgTitle->getPrefixedText() );
10171019 $form .= wfHidden( 'oldid', $id );
@@ -1039,8 +1041,8 @@
10401042 "<p><textarea tabindex='1' name='wpNotes' id='wpNotes' rows='2' cols='80' style='width:100%'></textarea>" .
10411043 "</p>\n";
10421044 }
1043 - $form .= "<p>".wfInputLabel( wfMsgHtml( 'revreview-log' ), 'wpReason', 'wpReason', 60 )."\n";
1044 - $imageParams = $templateParams = '';
 1045+
 1046+ $imageParams = $templateParams = '';
10451047 if( !isset($out->mTemplateIds) || !isset($out->mImageTimestamps) ) {
10461048 return; // something went terribly wrong...
10471049 }
@@ -1058,6 +1060,14 @@
10591061 }
10601062 $form .= Xml::hidden( 'imageParams', $imageParams ) . "\n";
10611063
 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>&nbsp;&nbsp;&nbsp;".Xml::check( 'wpWatchthis', $watchChecked, $watchAttribs );
 1068+ $form .= "&nbsp;<label for='wpWatchthis'".$skin->tooltipAndAccesskey('watch').">{$watchLabel}</label></p>";
 1069+
 1070+ $form .= "<p>".wfInputLabel( wfMsgHtml( 'revreview-log' ), 'wpReason', 'wpReason', 60 )."\n";
 1071+
10621072 $form .= Xml::submitButton( wfMsgHtml( 'revreview-submit' ) ) . "</p></fieldset>";
10631073 $form .= Xml::closeElement( 'form' );
10641074
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php
@@ -220,7 +220,7 @@
221221 }
222222
223223 function submit( $request ) {
224 - global $wgOut;
 224+ global $wgOut, $wgUser;
225225
226226 $approved = false;
227227 # If all values are set to zero, this has been unapproved
@@ -247,6 +247,8 @@
248248 $this->approveRevision( $rev, $this->notes ) : $this->unapproveRevision( $frev );
249249 // Return to our page
250250 if ( $success ) {
 251+ if( $request->getCheck( 'wpWatchthis' ) )
 252+ $wgUser->addWatch( $this->page );
251253 $wgOut->redirect( $this->page->escapeLocalUrl() );
252254 } else {
253255 $wgOut->showErrorPage( 'internalerror', 'badarticleerror' );
@@ -373,10 +375,6 @@
374376 $u = new LinksUpdate( $this->page, $poutput );
375377 $u->doUpdate(); // this will trigger our hook to add stable links too...
376378
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 -
381379 # Clear the cache...
382380 $this->page->invalidateCache();
383381 # Might as well save the cache
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -52,7 +52,7 @@
5353 See the [[Special:Unreviewedpages]] for a list of
5454 unreviewed pages.',
5555 '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
5757 revision.",
5858 'revreview-toolow' => 'You must at least rate each of the below attributes higher than "unapproved" in order
5959 for a revision to be considered reviewed. To depreciate a revision, set all fields to "unapproved".',

Status & tagging log