r25486 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25485‎ | r25486 | r25487 >
Date:16:21, 4 September 2007
Author:aaron
Status:old
Tags:
Comment:
*Draft tab should show on talk pages too
*Fiddle with tabs and messages some more
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -1539,20 +1539,19 @@
15401540 return true;
15411541 }
15421542 */
 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+
15431551 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 - }
15491552 return true;
15501553 }
15511554 // Note that revisions may not be set to override for users
15521555 if( $this->pageOverride() ) {
1553 - # Remove edit option altogether
1554 - unset( $content_actions['edit'] );
1555 - unset( $content_actions['viewsource'] );
1556 -
15571556 $new_actions = array(); $counter = 0;
15581557 # Straighten out order
15591558 foreach( $content_actions as $tab_action => $data ) {
@@ -1781,9 +1780,8 @@
17821781 */
17831782 function getOverridingRev( $title = NULL, $getText=false, $forUpdate=false ) {
17841783 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();
17881786
17891787 if( !$forUpdate ) {
17901788 if( !$row = $this->getLatestQualityRev( $getText ) ) {
@@ -1811,9 +1809,9 @@
18121810 // Skip deleted revisions
18131811 $result = $dbw->select( array('page', 'flaggedrevs', 'revision'),
18141812 $selectColumns,
1815 - array('page_namespace' => $wgTitle->getNamespace(), 'page_title' => $wgTitle->getDBkey(),
 1813+ array('page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey(),
18161814 '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'),
18181816 __METHOD__,
18191817 array('LIMIT' => 1) );
18201818
@@ -1839,6 +1837,8 @@
18401838 */
18411839 function getLatestQualityRev( $getText=false ) {
18421840 global $wgTitle;
 1841+ // Get the content page, skip talk
 1842+ $title = $wgTitle->getSubjectPage();
18431843 // Cached results available?
18441844 if( isset($this->qualityfound) ) {
18451845 return ( $this->qualityfound ) ? $this->qualityrev : null;
@@ -1854,8 +1854,8 @@
18551855 // Skip deleted revisions
18561856 $result = $dbr->select( array('flaggedrevs', 'revision'),
18571857 $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'),
18601860 __METHOD__,
18611861 array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) );
18621862
@@ -1879,6 +1879,8 @@
18801880 */
18811881 function getLatestStableRev( $getText=false ) {
18821882 global $wgTitle;
 1883+ // Get the content page, skip talk
 1884+ $title = $wgTitle->getSubjectPage();
18831885 // Cached results available?
18841886 if( isset($this->latestfound) ) {
18851887 return ( $this->latestfound ) ? $this->latestrev : NULL;
@@ -1894,8 +1896,8 @@
18951897 // Skip deleted revisions
18961898 $result = $dbr->select( array('flaggedrevs', 'revision'),
18971899 $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'),
19001902 __METHOD__,
19011903 array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) );
19021904
@@ -1926,15 +1928,15 @@
19271929 $flags[$tag] = 0;
19281930 }
19291931
1930 - $db = wfGetDB( DB_SLAVE );
 1932+ $dbr = wfGetDB( DB_SLAVE );
19311933 // Grab all the tags for this revision
1932 - $result = $db->select('flaggedrevtags',
 1934+ $result = $dbr->select('flaggedrevtags',
19331935 array('frt_dimension', 'frt_value'),
19341936 array('frt_rev_id' => $rev_id),
19351937 __METHOD__ );
19361938
19371939 // Iterate through each tag result
1938 - while( $row = $db->fetchObject($result) ) {
 1940+ while( $row = $dbr->fetchObject($result) ) {
19391941 $flags[$row->frt_dimension] = $row->frt_value;
19401942 }
19411943 // Try to cache results
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -14,7 +14,9 @@
1515 'group-reviewer-member' => 'Reviewer',
1616 'grouppage-reviewer' => '{{ns:project}}:Reviewer',
1717
18 - 'revreview-current' => 'Draft (editable)',
 18+ 'revreview-current' => 'Draft',
 19+ 'revreview-edit' => 'Edit draft',
 20+ 'revreview-source' => 'draft source',
1921 'revreview-stable' => 'Stable version',
2022 'revreview-oldrating' => 'It was rated as:',
2123 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been

Status & tagging log