r67061 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67060‎ | r67061 | r67062 >
Date:01:40, 30 May 2010
Author:aaron
Status:ok
Tags:
Comment:
* Some hook cleanup
* Added label to edit checkbox
* Bumped style version
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -301,7 +301,7 @@
302302 $wgAvailableRights[] = 'stablesettings';
303303
304304 # Bump this number every time you change flaggedrevs.css/flaggedrevs.js
305 -$wgFlaggedRevStyleVersion = 73;
 305+$wgFlaggedRevStyleVersion = 74;
306306
307307 $wgExtensionFunctions[] = 'efLoadFlaggedRevs';
308308
@@ -408,7 +408,7 @@
409409 # ######## User interface #########
410410 # Override current revision, add patrol links, set cache...
411411 $wgHooks['ArticleViewHeader'][] = 'FlaggedRevsHooks::onArticleViewHeader';
412 -$wgHooks['ImagePageFindFile'][] = 'FlaggedRevsHooks::imagePageFindFile';
 412+$wgHooks['ImagePageFindFile'][] = 'FlaggedRevsHooks::onImagePageFindFile';
413413 # Override redirect behavior...
414414 $wgHooks['InitializeArticleMaybeRedirect'][] = 'FlaggedRevsHooks::overrideRedirect';
415415 # Set page view tabs
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -112,6 +112,8 @@
113113 'revreview-edit' => 'Edit',
114114 'revreview-editnotice' => '\'\'\'Your changes will be accepted once an authorized user reviews them. ([[{{MediaWiki:Validationpage}}|?]])\'\'\'',
115115 'revreview-check-flag' => 'Accept the pending changes',
 116+ 'revreview-check-flag-title' => 'Accept all the currently pending changes along with your own edit.
 117+ Only use this only if you\'ve already seen the entire pending changes diff.',
116118 'revreview-submitedit' => 'Submit changes',
117119 'revreview-submitedit-title' => 'Submit your changes for review',
118120 'revreview-edited' => '\'\'\'Changes will be accepted once an authorized user reviews them. ([[{{MediaWiki:Validationpage}}|?]])\'\'\'
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1634,7 +1634,7 @@
16351635 return true;
16361636 }
16371637
1638 - public static function imagePageFindFile( $imagePage, &$normalFile, &$displayFile ) {
 1638+ public static function onImagePageFindFile( $imagePage, &$normalFile, &$displayFile ) {
16391639 $view = FlaggedArticleView::singleton();
16401640 $view->imagePageFindFile( $normalFile, $displayFile );
16411641 return true;
@@ -1998,30 +1998,9 @@
19991999 return true;
20002000 }
20012001
2002 - // TODO: move to articleview class?
2003 - // FIXME: add title attrib
20042002 public static function addReviewCheck( $editPage, &$checkboxes, &$tabindex ) {
2005 - global $wgUser, $wgRequest;
2006 - if ( !$wgUser->isAllowed( 'review' ) ) {
2007 - return true;
2008 - }
2009 - if ( FlaggedRevs::autoReviewNewPages() && !$editPage->getArticle()->getId() ) {
2010 - return true; // not needed
2011 - }
2012 - $fa = FlaggedArticleView::globalArticleInstance();
2013 - if ( $fa->isReviewable() ) {
2014 - $srev = $fa->getStableRev();
2015 - # For pages with either no stable version, or an outdated one, let
2016 - # the user decide if he/she wants it reviewed on the spot. One might
2017 - # do this if he/she just saw the diff-to-stable and *then* decided to edit.
2018 - if ( !$srev || $srev->getRevId() != $editPage->getArticle()->getLatest() ) {
2019 - $reviewLabel = wfMsgExt( 'revreview-check-flag', 'parseinline' );
2020 - $attribs = array( 'tabindex' => ++$tabindex, 'id' => 'wpReviewEdit' );
2021 - $checkboxes['reviewed'] = Xml::check( 'wpReviewEdit',
2022 - $wgRequest->getCheck( 'wpReviewEdit' ), $attribs ) .
2023 - ' ' . Xml::label( $reviewLabel, 'wpReviewEdit' );
2024 - }
2025 - }
 2003+ $view = FlaggedArticleView::singleton();
 2004+ $view->addReviewCheck( $editPage, $checkboxes, $tabindex );
20262005 return true;
20272006 }
20282007
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -1525,6 +1525,40 @@
15261526 }
15271527
15281528 /**
 1529+ * Add a "review pending changes" checkbox to the edit form
 1530+ * if there are currently any revisions pending. (bug 16713)
 1531+ */
 1532+ public function addReviewCheck( $editPage, &$checkboxes, &$tabindex ) {
 1533+ global $wgUser, $wgRequest;
 1534+ if ( !$wgUser->isAllowed( 'review' ) ) {
 1535+ return true;
 1536+ } elseif ( FlaggedRevs::autoReviewNewPages() && !$this->article->exists() ) {
 1537+ return true; // not needed
 1538+ }
 1539+ if ( $this->article->isReviewable() ) {
 1540+ $srev = $this->article->getStableRev();
 1541+ # For pages with either no stable version, or an outdated one, let
 1542+ # the user decide if he/she wants it reviewed on the spot. One might
 1543+ # do this if he/she just saw the diff-to-stable and *then* decided to edit.
 1544+ if ( !$srev || $srev->getRevId() != $this->article->getLatest() ) {
 1545+ $checkbox = Xml::check(
 1546+ 'wpReviewEdit',
 1547+ $wgRequest->getCheck( 'wpReviewEdit' ),
 1548+ array( 'tabindex' => ++$tabindex, 'id' => 'wpReviewEdit' )
 1549+ );
 1550+ $attribs = array(
 1551+ 'for' => 'wpReviewEdit',
 1552+ 'title' => wfMsg( 'revreview-check-flag-title' )
 1553+ );
 1554+ $label = Xml::element( 'label', $attribs,
 1555+ wfMsgExt( 'revreview-check-flag', 'parseinline' ) );
 1556+ $checkboxes['reviewed'] = $checkbox . ' ' . $label;
 1557+ }
 1558+ }
 1559+ return true;
 1560+ }
 1561+
 1562+ /**
15291563 * (a) Add a hidden field that has the rev ID the text is based off.
15301564 * (b) If an edit was undone, add a hidden field that has the rev ID of that edit.
15311565 * Needed for autoreview and user stats (for autopromote).

Status & tagging log