Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | $wgAvailableRights[] = 'stablesettings'; |
303 | 303 | |
304 | 304 | # Bump this number every time you change flaggedrevs.css/flaggedrevs.js |
305 | | -$wgFlaggedRevStyleVersion = 73; |
| 305 | +$wgFlaggedRevStyleVersion = 74; |
306 | 306 | |
307 | 307 | $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; |
308 | 308 | |
— | — | @@ -408,7 +408,7 @@ |
409 | 409 | # ######## User interface ######### |
410 | 410 | # Override current revision, add patrol links, set cache... |
411 | 411 | $wgHooks['ArticleViewHeader'][] = 'FlaggedRevsHooks::onArticleViewHeader'; |
412 | | -$wgHooks['ImagePageFindFile'][] = 'FlaggedRevsHooks::imagePageFindFile'; |
| 412 | +$wgHooks['ImagePageFindFile'][] = 'FlaggedRevsHooks::onImagePageFindFile'; |
413 | 413 | # Override redirect behavior... |
414 | 414 | $wgHooks['InitializeArticleMaybeRedirect'][] = 'FlaggedRevsHooks::overrideRedirect'; |
415 | 415 | # Set page view tabs |
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -112,6 +112,8 @@ |
113 | 113 | 'revreview-edit' => 'Edit', |
114 | 114 | 'revreview-editnotice' => '\'\'\'Your changes will be accepted once an authorized user reviews them. ([[{{MediaWiki:Validationpage}}|?]])\'\'\'', |
115 | 115 | '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.', |
116 | 118 | 'revreview-submitedit' => 'Submit changes', |
117 | 119 | 'revreview-submitedit-title' => 'Submit your changes for review', |
118 | 120 | '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 @@ |
1635 | 1635 | return true; |
1636 | 1636 | } |
1637 | 1637 | |
1638 | | - public static function imagePageFindFile( $imagePage, &$normalFile, &$displayFile ) { |
| 1638 | + public static function onImagePageFindFile( $imagePage, &$normalFile, &$displayFile ) { |
1639 | 1639 | $view = FlaggedArticleView::singleton(); |
1640 | 1640 | $view->imagePageFindFile( $normalFile, $displayFile ); |
1641 | 1641 | return true; |
— | — | @@ -1998,30 +1998,9 @@ |
1999 | 1999 | return true; |
2000 | 2000 | } |
2001 | 2001 | |
2002 | | - // TODO: move to articleview class? |
2003 | | - // FIXME: add title attrib |
2004 | 2002 | 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 ); |
2026 | 2005 | return true; |
2027 | 2006 | } |
2028 | 2007 | |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -1525,6 +1525,40 @@ |
1526 | 1526 | } |
1527 | 1527 | |
1528 | 1528 | /** |
| 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 | + /** |
1529 | 1563 | * (a) Add a hidden field that has the rev ID the text is based off. |
1530 | 1564 | * (b) If an edit was undone, add a hidden field that has the rev ID of that edit. |
1531 | 1565 | * Needed for autoreview and user stats (for autopromote). |