Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1841,31 +1841,27 @@ |
1842 | 1842 | if ( !$wgUser->isAllowed( 'review' ) ) { |
1843 | 1843 | return true; // not relevant to user |
1844 | 1844 | } |
1845 | | - $title = $out->getTitle(); |
1846 | 1845 | $namespaces = FlaggedRevs::getReviewNamespaces(); |
1847 | | - if ( $title->getNamespace() == NS_SPECIAL && $namespaces ) { |
1848 | | - $watchlist = SpecialPage::getTitleFor( 'Watchlist' ); |
1849 | | - $recentchanges = SpecialPage::getTitleFor( 'Recentchanges' ); |
1850 | | - # Notice applies only to RC/watchlists |
1851 | | - if ( $title->equals( $watchlist ) || $title->equals( $recentchanges ) ) { |
1852 | | - $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); // consistency with watchlist |
1853 | | - $watchedOutdated = $dbr->selectField( |
1854 | | - array( 'watchlist', 'page', 'flaggedpages' ), |
1855 | | - '1', // existence |
1856 | | - array( 'wl_user' => $wgUser->getId(), // this user |
1857 | | - 'wl_namespace' => $namespaces, // reviewable |
1858 | | - 'wl_namespace = page_namespace', |
1859 | | - 'wl_title = page_title', |
1860 | | - 'fp_page_id = page_id', |
1861 | | - 'fp_reviewed' => 0, // edits pending |
1862 | | - ), __METHOD__ |
1863 | | - ); |
1864 | | - # Give a notice if pages on the users's wachlist have pending edits |
1865 | | - if ( $watchedOutdated ) { |
1866 | | - $css = 'plainlinks fr-watchlist-pending-notice'; |
1867 | | - $out->prependHTML( "<div id='mw-fr-watchlist-pending-notice' class='$css'>" . |
1868 | | - wfMsgExt( 'flaggedrevs-watched-pending', 'parseinline' ) . "</div>" ); |
1869 | | - } |
| 1846 | + $watchlist = SpecialPage::getTitleFor( 'Watchlist' ); |
| 1847 | + # Add notice to watchlist about pending changes... |
| 1848 | + if ( $out->getTitle()->equals( $watchlist ) && $namespaces ) { |
| 1849 | + $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); // consistency with watchlist |
| 1850 | + $watchedOutdated = (bool)$dbr->selectField( |
| 1851 | + array( 'watchlist', 'page', 'flaggedpages' ), |
| 1852 | + '1', // existence |
| 1853 | + array( 'wl_user' => $wgUser->getId(), // this user |
| 1854 | + 'wl_namespace' => $namespaces, // reviewable |
| 1855 | + 'wl_namespace = page_namespace', |
| 1856 | + 'wl_title = page_title', |
| 1857 | + 'fp_page_id = page_id', |
| 1858 | + 'fp_pending_since IS NOT NULL', // edits pending |
| 1859 | + ), __METHOD__ |
| 1860 | + ); |
| 1861 | + # Give a notice if pages on the users's wachlist have pending edits |
| 1862 | + if ( $watchedOutdated ) { |
| 1863 | + $css = 'plainlinks fr-watchlist-pending-notice'; |
| 1864 | + $out->prependHTML( "<div id='mw-fr-watchlist-pending-notice' class='$css'>" . |
| 1865 | + wfMsgExt( 'flaggedrevs-watched-pending', 'parseinline' ) . "</div>" ); |
1870 | 1866 | } |
1871 | 1867 | } |
1872 | 1868 | return true; |