r97896 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97895‎ | r97896 | r97897 >
Date:08:07, 23 September 2011
Author:aaron
Status:ok
Tags:
Comment:
Moved down 'Templates/files updated' clutter on review form
Modified paths:
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php
@@ -13,6 +13,7 @@
1414 protected $isMultiPageDiff = false;
1515 protected $reviewNotice = '';
1616 protected $diffNoticeBox = '';
 17+ protected $diffIncChangeBox = '';
1718 protected $reviewFormRev = false;
1819
1920 protected $loaded = false;
@@ -1094,6 +1095,7 @@
10951096 }
10961097 # Review notice box goes in top of form
10971098 $form->setTopNotice( $this->diffNoticeBox );
 1099+ $form->setBottomNotice( $this->diffIncChangeBox );
10981100
10991101 # Set the file version we are viewing (for File: pages)
11001102 $form->setFileVersion( $this->out->getFileVersion() );
@@ -1387,7 +1389,7 @@
13881390 && $this->isDiffFromStable
13891391 && !$this->article->stableVersionIsSynced() ) // pending changes
13901392 {
1391 - $changeDiv = '';
 1393+ $changeText = '';
13921394 $this->reviewFormRev = $newRev;
13931395 $changeList = array();
13941396 # Page not synced only due to includes?
@@ -1413,7 +1415,6 @@
14141416 }
14151417 # If there are pending revs or templates/files changes, notify the user...
14161418 if ( $this->article->revsArePending() || count( $changeList ) ) {
1417 - $changeDiv = '';
14181419 # If the user can review then prompt them to review them...
14191420 if ( $wgUser->isAllowed( 'review' ) ) {
14201421 // Reviewer just edited...
@@ -1433,22 +1434,23 @@
14341435 } else {
14351436 $msg = 'revreview-update'; // generic "please review" notice...
14361437 }
1437 - $changeDiv .= wfMsgExt( $msg, 'parse' );
 1438+ $this->diffNoticeBox = wfMsgExt( $msg, 'parse' ); // add as part of form
14381439 }
14391440 # Add include change list...
14401441 if ( count( $changeList ) ) { // just inclusion changes
1441 - $changeDiv .= "<p>" .
 1442+ $changeText .= "<p>" .
14421443 wfMsgExt( 'revreview-update-includes', 'parseinline' ) .
14431444 '&#160;' . implode( ', ', $changeList ) . "</p>\n";
14441445 }
14451446 }
1446 - if ( $changeDiv != '' ) {
 1447+ # template/file change list
 1448+ if ( $changeText != '' ) {
14471449 if ( $wgUser->isAllowed( 'review' ) ) {
1448 - $this->diffNoticeBox = $changeDiv; // add as part of form
 1450+ $this->diffIncChangeBox = "<p>$changeText</p>";
14491451 } else {
14501452 $css = 'flaggedrevs_diffnotice plainlinks';
14511453 $this->out->addHTML(
1452 - "<div id='mw-fr-difftostable' class='$css'>$changeDiv</div>\n"
 1454+ "<div id='mw-fr-difftostable' class='$css'>$changeText</div>\n"
14531455 );
14541456 }
14551457 }
Index: trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php
@@ -8,6 +8,7 @@
99 protected $user, $article, $rev;
1010 protected $refRev = null;
1111 protected $topNotice = '';
 12+ protected $bottomNotice = '';
1213 protected $fileVersion = null;
1314 protected $templateIDs = null;
1415 protected $imageSHA1Keys = null;
@@ -36,13 +37,21 @@
3738
3839 /*
3940 * Add on a notice inside the review box at the top
40 - * @param string $topNotice Text to
 41+ * @param string $notice HTML to show
4142 */
42 - public function setTopNotice( $topNotice ) {
43 - $this->topNotice = (string)$topNotice;
 43+ public function setTopNotice( $notice ) {
 44+ $this->topNotice = (string)$notice;
4445 }
4546
4647 /*
 48+ * Add on a notice inside the review box at the top
 49+ * @param string $notice HTML to show
 50+ */
 51+ public function setBottomNotice( $notice ) {
 52+ $this->bottomNotice = (string)$notice;
 53+ }
 54+
 55+ /*
4756 * Set the file version parameters of what the user is viewing
4857 * @param Array|null $version ('time' => MW timestamp, 'sha1' => sha1)
4958 */
@@ -215,6 +224,9 @@
216225 }
217226 $form .= Xml::closeElement( 'div' ) . "\n";
218227
 228+ # Show explanatory text
 229+ $form .= $this->bottomNotice;
 230+
219231 # Hidden params
220232 $form .= Html::hidden( 'title', $reviewTitle->getPrefixedText() ) . "\n";
221233 $form .= Html::hidden( 'target', $article->getTitle()->getPrefixedDBKey() ) . "\n";

Status & tagging log