Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -1539,20 +1539,19 @@ |
1540 | 1540 | return true; |
1541 | 1541 | } |
1542 | 1542 | */ |
| 1543 | + // Be clear about what is being edited... |
| 1544 | + if( !$sktmp->mTitle->isTalkPage() ) { |
| 1545 | + if( isset( $content_actions['edit'] ) ) |
| 1546 | + $content_actions['edit']['text'] = wfMsg('revreview-edit'); |
| 1547 | + if( isset( $content_actions['viewsource'] ) ) |
| 1548 | + $content_actions['viewsource']['text'] = wfMsg('revreview-source'); |
| 1549 | + } |
| 1550 | + |
1543 | 1551 | if( !$wgFlaggedRevTabs ) { |
1544 | | - if( $this->pageOverride() ) { |
1545 | | - # Remove edit option altogether, unless it's the current revision |
1546 | | - unset( $content_actions['edit'] ); |
1547 | | - unset( $content_actions['viewsource'] ); |
1548 | | - } |
1549 | 1552 | return true; |
1550 | 1553 | } |
1551 | 1554 | // Note that revisions may not be set to override for users |
1552 | 1555 | if( $this->pageOverride() ) { |
1553 | | - # Remove edit option altogether |
1554 | | - unset( $content_actions['edit'] ); |
1555 | | - unset( $content_actions['viewsource'] ); |
1556 | | - |
1557 | 1556 | $new_actions = array(); $counter = 0; |
1558 | 1557 | # Straighten out order |
1559 | 1558 | foreach( $content_actions as $tab_action => $data ) { |
— | — | @@ -1781,9 +1780,8 @@ |
1782 | 1781 | */ |
1783 | 1782 | function getOverridingRev( $title = NULL, $getText=false, $forUpdate=false ) { |
1784 | 1783 | global $wgTitle; |
1785 | | - |
1786 | | - if( !is_null($title) && $title->getArticleID() != $wgTitle->getArticleID() ) |
1787 | | - return null; // wtf? |
| 1784 | + // Get the content page, skip talk |
| 1785 | + $title = $wgTitle->getSubjectPage(); |
1788 | 1786 | |
1789 | 1787 | if( !$forUpdate ) { |
1790 | 1788 | if( !$row = $this->getLatestQualityRev( $getText ) ) { |
— | — | @@ -1811,9 +1809,9 @@ |
1812 | 1810 | // Skip deleted revisions |
1813 | 1811 | $result = $dbw->select( array('page', 'flaggedrevs', 'revision'), |
1814 | 1812 | $selectColumns, |
1815 | | - array('page_namespace' => $wgTitle->getNamespace(), 'page_title' => $wgTitle->getDBkey(), |
| 1813 | + array('page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey(), |
1816 | 1814 | 'page_ext_stable = fr_rev_id', 'fr_rev_id = rev_id', 'fr_quality >= 1', |
1817 | | - 'rev_page' => $wgTitle->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'), |
| 1815 | + 'rev_page' => $title->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'), |
1818 | 1816 | __METHOD__, |
1819 | 1817 | array('LIMIT' => 1) ); |
1820 | 1818 | |
— | — | @@ -1839,6 +1837,8 @@ |
1840 | 1838 | */ |
1841 | 1839 | function getLatestQualityRev( $getText=false ) { |
1842 | 1840 | global $wgTitle; |
| 1841 | + // Get the content page, skip talk |
| 1842 | + $title = $wgTitle->getSubjectPage(); |
1843 | 1843 | // Cached results available? |
1844 | 1844 | if( isset($this->qualityfound) ) { |
1845 | 1845 | return ( $this->qualityfound ) ? $this->qualityrev : null; |
— | — | @@ -1854,8 +1854,8 @@ |
1855 | 1855 | // Skip deleted revisions |
1856 | 1856 | $result = $dbr->select( array('flaggedrevs', 'revision'), |
1857 | 1857 | $selectColumns, |
1858 | | - array('fr_namespace' => $wgTitle->getNamespace(), 'fr_title' => $wgTitle->getDBkey(), 'fr_quality >= 1', |
1859 | | - 'fr_rev_id = rev_id', 'rev_page' => $wgTitle->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'), |
| 1858 | + array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), 'fr_quality >= 1', |
| 1859 | + 'fr_rev_id = rev_id', 'rev_page' => $title->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'), |
1860 | 1860 | __METHOD__, |
1861 | 1861 | array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) ); |
1862 | 1862 | |
— | — | @@ -1879,6 +1879,8 @@ |
1880 | 1880 | */ |
1881 | 1881 | function getLatestStableRev( $getText=false ) { |
1882 | 1882 | global $wgTitle; |
| 1883 | + // Get the content page, skip talk |
| 1884 | + $title = $wgTitle->getSubjectPage(); |
1883 | 1885 | // Cached results available? |
1884 | 1886 | if( isset($this->latestfound) ) { |
1885 | 1887 | return ( $this->latestfound ) ? $this->latestrev : NULL; |
— | — | @@ -1894,8 +1896,8 @@ |
1895 | 1897 | // Skip deleted revisions |
1896 | 1898 | $result = $dbr->select( array('flaggedrevs', 'revision'), |
1897 | 1899 | $selectColumns, |
1898 | | - array('fr_namespace' => $wgTitle->getNamespace(), 'fr_title' => $wgTitle->getDBkey(), |
1899 | | - 'fr_rev_id = rev_id', 'rev_page' => $wgTitle->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'), |
| 1900 | + array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), |
| 1901 | + 'fr_rev_id = rev_id', 'rev_page' => $title->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'), |
1900 | 1902 | __METHOD__, |
1901 | 1903 | array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) ); |
1902 | 1904 | |
— | — | @@ -1926,15 +1928,15 @@ |
1927 | 1929 | $flags[$tag] = 0; |
1928 | 1930 | } |
1929 | 1931 | |
1930 | | - $db = wfGetDB( DB_SLAVE ); |
| 1932 | + $dbr = wfGetDB( DB_SLAVE ); |
1931 | 1933 | // Grab all the tags for this revision |
1932 | | - $result = $db->select('flaggedrevtags', |
| 1934 | + $result = $dbr->select('flaggedrevtags', |
1933 | 1935 | array('frt_dimension', 'frt_value'), |
1934 | 1936 | array('frt_rev_id' => $rev_id), |
1935 | 1937 | __METHOD__ ); |
1936 | 1938 | |
1937 | 1939 | // Iterate through each tag result |
1938 | | - while( $row = $db->fetchObject($result) ) { |
| 1940 | + while( $row = $dbr->fetchObject($result) ) { |
1939 | 1941 | $flags[$row->frt_dimension] = $row->frt_value; |
1940 | 1942 | } |
1941 | 1943 | // Try to cache results |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php |
— | — | @@ -14,7 +14,9 @@ |
15 | 15 | 'group-reviewer-member' => 'Reviewer', |
16 | 16 | 'grouppage-reviewer' => '{{ns:project}}:Reviewer', |
17 | 17 | |
18 | | - 'revreview-current' => 'Draft (editable)', |
| 18 | + 'revreview-current' => 'Draft', |
| 19 | + 'revreview-edit' => 'Edit draft', |
| 20 | + 'revreview-source' => 'draft source', |
19 | 21 | 'revreview-stable' => 'Stable version', |
20 | 22 | 'revreview-oldrating' => 'It was rated as:', |
21 | 23 | 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been |