Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1809,8 +1809,11 @@ |
1810 | 1810 | // Code stolen from Stabilization (which was stolen from ProtectionForm) |
1811 | 1811 | public static function onProtectionForm( $article, &$output ) { |
1812 | 1812 | global $wgUser, $wgRequest, $wgOut, $wgLang; |
1813 | | - if( !count( FlaggedRevs::getProtectionLevels() ) ) |
| 1813 | + if( !count( FlaggedRevs::getProtectionLevels() ) ) { |
1814 | 1814 | return true; // nothing to do |
| 1815 | + } else if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { |
| 1816 | + return true; // not a reviewable page |
| 1817 | + } |
1815 | 1818 | # Can the user actually do anything? |
1816 | 1819 | $isAllowed = $wgUser->isAllowed('stablesettings'); |
1817 | 1820 | $disabledAttrib = !$isAllowed ? array( 'disabled' => 'disabled' ) : array(); |
— | — | @@ -1931,6 +1934,11 @@ |
1932 | 1935 | |
1933 | 1936 | // Add stability log extract to protection form |
1934 | 1937 | public static function insertStabilityLog( $article, $out ) { |
| 1938 | + if( !count( FlaggedRevs::getProtectionLevels() ) ) { |
| 1939 | + return true; // nothing to do |
| 1940 | + } else if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { |
| 1941 | + return true; // not a reviewable page |
| 1942 | + } |
1935 | 1943 | # Show relevant lines from the stability log: |
1936 | 1944 | $out->addHTML( Xml::element( 'h2', null, LogPage::logName('stable') ) ); |
1937 | 1945 | LogEventsList::showLogExtract( $out, 'stable', $article->getTitle()->getPrefixedText() ); |
— | — | @@ -1946,6 +1954,9 @@ |
1947 | 1955 | if( wfReadOnly() || !$wgUser->isAllowed('stablesettings') ) { |
1948 | 1956 | return true; // user cannot change anything |
1949 | 1957 | } |
| 1958 | + if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { |
| 1959 | + return true; // not a reviewable page |
| 1960 | + } |
1950 | 1961 | $form = new Stabilization(); |
1951 | 1962 | $form->target = $article->getTitle(); # Our target page |
1952 | 1963 | $form->watchThis = null; // protection form already has a watch check |