r26137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26136‎ | r26137 | r26138 >
Date:22:27, 25 September 2007
Author:aaron
Status:old
Tags:
Comment:
*Add a feature to configure stable version precedence and whether to override
*Random cleanup and fixes
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.pg.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -8,9 +8,13 @@
99
1010 if( !defined( 'FLAGGED_CSS' ) )
1111 define('FLAGGED_CSS', $wgScriptPath.'/extensions/FlaggedRevs/flaggedrevs.css' );
12 -if( !defined( 'FLAGGED_JS' ) )
 12+if( !defined( 'FLAGGED_JS' ) )
1313 define('FLAGGED_JS', $wgScriptPath.'/extensions/FlaggedRevs/flaggedrevs.js' );
14 -
 14+if( !defined( 'FLAGGED_VIS_NORMAL' ) )
 15+ define('FLAGGED_VIS_NORMAL',0);
 16+if( !defined( 'FLAGGED_VIS_LATEST' ) )
 17+ define('FLAGGED_VIS_LATEST',1);
 18+
1519 $wgExtensionCredits['parserhook'][] = array(
1620 'author' => 'Aaron Schulz',
1721 'name' => 'Flagged Revisions',
@@ -38,6 +42,8 @@
3943 # Load unreviewed pages list
4044 $wgSpecialPages['Unreviewedpages'] = 'Unreviewedpages';
4145 $wgAutoloadClasses['Unreviewedpages'] = dirname(__FILE__) . '/FlaggedRevsPage_body.php';
 46+# Stable version config
 47+extAddSpecialPage( dirname(__FILE__) . '/FlaggedRevsPage_body.php', 'Stabilization', 'Stabilization' );
4248
4349
4450 function efLoadFlaggedRevs() {
@@ -69,10 +75,12 @@
7076 # Use only our extension mechanisms
7177 $wgGroupPermissions['sysop']['autopatrol'] = false;
7278 $wgGroupPermissions['sysop']['patrol'] = false;
 79+ # Visiblity settings
 80+ $wgGroupPermissions['sysop']['stablesettings'] =true;
7381
7482 ######### Hook attachments #########
7583 # Main hooks, overrides pages content, adds tags, sets tabs and permalink
76 - $wgHooks['SkinTemplateTabs'][] = array( $wgFlaggedArticle, 'setCurrentTab');
 84+ $wgHooks['SkinTemplateTabs'][] = array( $wgFlaggedArticle, 'setActionTabs');
7785 # Update older, incomplete, page caches (ones that lack template Ids/image timestamps)
7886 $wgHooks['ArticleViewHeader'][] = array( $wgFlaggedArticle, 'maybeUpdateMainCache');
7987 $wgHooks['ArticleViewHeader'][] = array($wgFlaggedArticle, 'setPageContent');
@@ -81,12 +89,15 @@
8290 $wgHooks['EditPage::showEditForm:initial'][] = array($wgFlaggedArticle, 'addToEditView');
8391 # Add review form
8492 $wgHooks['BeforePageDisplay'][] = array($wgFlaggedArticle, 'addReviewForm');
 93+ $wgHooks['BeforePageDisplay'][] = array($wgFlaggedArticle, 'addVisibilityLink');
8594 # Mark of items in page history
8695 $wgHooks['PageHistoryLineEnding'][] = array($wgFlaggedArticle, 'addToHistLine');
8796 # Autopromote Editors
8897 $wgHooks['ArticleSaveComplete'][] = array($wgFlaggedArticle, 'autoPromoteUser');
8998 # Adds table link references to include ones from the stable version
9099 $wgHooks['LinksUpdateConstructed'][] = array($wgFlaggedArticle, 'extraLinksUpdate');
 100+ # Empty flagged page settings row on delete
 101+ $wgHooks['ArticleDelete'][] = array($wgFlaggedArticle, 'deleteVisiblitySettings');
91102 # Check on undelete/merge/revisiondelete for changes to stable version
92103 $wgHooks['ArticleUndelete'][] = array($wgFlaggedArticle, 'articleLinksUpdate2');
93104 $wgHooks['ArticleRevisionVisiblitySet'][] = array($wgFlaggedArticle, 'articleLinksUpdate2');
@@ -204,8 +215,9 @@
205216 $wgLogTypes[] = 'review';
206217 $wgLogNames['review'] = 'review-logpage';
207218 $wgLogHeaders['review'] = 'review-logpagetext';
208 -$wgLogActions['review/approve'] = 'review-logentrygrant';
209 -$wgLogActions['review/unapprove'] = 'review-logentryrevoke';
 219+$wgLogActions['review/approve'] = 'review-logentry-app';
 220+$wgLogActions['review/unapprove'] = 'review-logentry-dis';
 221+$wgLogActions['review/config'] = 'review-logentry-conf';
210222 $wgLogActions['rights/erevoke'] = 'rights-editor-revoke';
211223 $wgLogActions['rights/egrant'] = 'rights-editor-grant';
212224
@@ -383,58 +395,109 @@
384396
385397 /**
386398 * Get latest quality rev, if not, the latest reviewed one.
387 - * @param Title $title, unused
 399+ * @param Title $title, page title
388400 * @param bool $getText, fetch fr_text and fr_flags too?
389401 * @param bool $forUpdate, use master DB and avoid using page_ext_stable?
390402 * @return Row
391403 */
392 - public function getOverridingRev( $title=NULL, $getText=false, $forUpdate=false ) {
393 - if( is_null($title) )
394 - return null;
395 -
 404+ public function getStableRev( $title, $getText=false, $forUpdate=false ) {
 405+ return $this->getStablePageRev( $title, $getText, $forUpdate );
 406+ }
 407+
 408+ /**
 409+ * Get latest quality rev, if not, the latest reviewed one.
 410+ * @param Title $title, page title
 411+ * @param bool $getText, fetch fr_text and fr_flags too?
 412+ * @param bool $forUpdate, use master DB and avoid using page_ext_stable?
 413+ * @param bool $def, is this for the default version of a page?
 414+ * @returns Row
 415+ */
 416+ public function getStablePageRev( $title, $getText=false, $forUpdate=false ) {
396417 $selectColumns = array('fr_rev_id','fr_user','fr_timestamp','fr_comment','rev_timestamp');
397418 if( $getText ) {
398419 $selectColumns[] = 'fr_text';
399420 $selectColumns[] = 'fr_flags';
400421 }
 422+ $row = null;
 423+ // Get visiblity settings...
 424+ $config = $this->getVisibilitySettings( $title, $forUpdate );
401425 # If we want the text, then get the text flags too
402426 if( !$forUpdate ) {
403427 $dbr = wfGetDB( DB_SLAVE );
404428 $result = $dbr->select( array('page', 'flaggedrevs', 'revision'),
405429 $selectColumns,
406 - array('page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey(),
407 - 'page_ext_stable = fr_rev_id', 'fr_rev_id = rev_id',
 430+ array('page_namespace' => $title->getNamespace(),
 431+ 'page_title' => $title->getDBkey(),
 432+ 'page_ext_stable = fr_rev_id',
 433+ 'fr_rev_id = rev_id',
408434 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
409435 __METHOD__,
410436 array('LIMIT' => 1) );
411437 if( !$row = $dbr->fetchObject($result) )
412438 return null;
413 -
414 - return $row;
 439+ } else {
 440+ $dbw = wfGetDB( DB_MASTER );
 441+ // Look for the latest quality revision
 442+ if( $config['select'] !== FLAGGED_VIS_LATEST ) {
 443+ $result = $dbw->select( array('flaggedrevs', 'revision'),
 444+ $selectColumns,
 445+ array('fr_namespace' => $title->getNamespace(),
 446+ 'fr_title' => $title->getDBkey(),
 447+ 'fr_quality >= 1',
 448+ 'fr_rev_id = rev_id',
 449+ 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
 450+ __METHOD__,
 451+ array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1) );
 452+ $row = $dbw->fetchObject($result);
 453+ }
 454+ // Do we have one? If not, try the latest reviewed revision...
 455+ if( !$row ) {
 456+ $result = $dbw->select( array('flaggedrevs', 'revision'),
 457+ $selectColumns,
 458+ array('fr_namespace' => $title->getNamespace(),
 459+ 'fr_title' => $title->getDBkey(),
 460+ 'fr_rev_id = rev_id',
 461+ 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
 462+ __METHOD__,
 463+ array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1) );
 464+ if( !$row = $dbw->fetchObject($result) )
 465+ return null;
 466+ }
415467 }
416 -
417 - $dbw = wfGetDB( DB_MASTER );
418 - // Look for quality revision
419 - $result = $dbw->select( array('flaggedrevs', 'revision'),
420 - $selectColumns,
421 - array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(),
422 - 'fr_quality >= 1', 'fr_rev_id = rev_id', 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
423 - __METHOD__,
424 - array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1) );
425 - // Do we have one? If not, try any reviewed revision...
426 - if( !$row = $dbw->fetchObject($result) ) {
427 - $result = $dbw->select( array('flaggedrevs', 'revision'),
428 - $selectColumns,
429 - array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(),
430 - 'fr_rev_id = rev_id', 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
431 - __METHOD__,
432 - array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1) );
433 - if( !$row = $dbw->fetchObject($result) )
434 - return null;
435 - }
436468 return $row;
437469 }
438470
 471+ /**
 472+ * Get visiblity restrictions on page
 473+ * @param Title $title, page title
 474+ * @param bool $forUpdate, use master DB?
 475+ * @returns Array
 476+ */
 477+ public function getVisibilitySettings( $title, $forUpdate=false ) {
 478+ return $this->getPageVisibilitySettings( $title, $forUpdate );
 479+ }
 480+
 481+ /**
 482+ * Get visiblity restrictions on page
 483+ * @param Title $title, page title
 484+ * @param bool $forUpdate, use master DB?
 485+ * @returns Array
 486+ */
 487+ public function getPageVisibilitySettings( $title, $forUpdate=false ) {
 488+ $db = $forUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
 489+ $row = $db->selectRow( 'flaggedpages',
 490+ array( 'fp_select', 'fp_override' ),
 491+ array( 'fp_page_id' => $title->getArticleID() ),
 492+ __METHOD__ );
 493+ if( !$row ) {
 494+ global $wgFlaggedRevsOverride;
 495+ // Keep this consistent across settings. 1 -> override, 0 -> don't
 496+ $override = $wgFlaggedRevsOverride ? 1 : 0;
 497+ return array('select' => 0, 'override' => $override);
 498+ }
 499+ return array('select' => $row->fp_select, 'override' => $row->fp_override);
 500+ }
 501+
439502 /**
440503 * Get flags for a revision
441504 * @param int $rev_id
@@ -453,7 +516,7 @@
454517 array('frt_rev_id' => $rev_id),
455518 __METHOD__ );
456519 # Iterate through each tag result
457 - while ( $row = $db->fetchObject($result) ) {
 520+ while( $row = $db->fetchObject($result) ) {
458521 $flags[$row->frt_dimension] = $row->frt_value;
459522 }
460523 return $flags;
@@ -496,8 +559,10 @@
497560
498561 $levelmarker = $level * 20 + 20; //XXX do this better
499562 if( $prettyBox ) {
500 - $tag .= "<tr><td><span class='fr-group'><span class='fr-text'>" . wfMsgHtml("revreview-$quality") .
501 - "</span></td><td><span class='fr-marker fr_value$levelmarker'>$valuetext</span></span></td></tr>\n";
 563+ $tag .= "<tr><td><span class='fr-group'><span class='fr-text'>" .
 564+ wfMsgHtml("revreview-$quality") .
 565+ "</span></td><td><span class='fr-marker fr_value$levelmarker'>" .
 566+ $valuetext . "</span></span></td></tr>\n";
502567 } else {
503568 $tag .= "&nbsp;<span class='fr-marker-$levelmarker'><strong>" .
504569 wfMsgHtml("revreview-$quality") .
@@ -826,12 +891,21 @@
827892 public function updateFromMove( $movePageForm, $oldtitle, $newtitle ) {
828893 $dbw = wfGetDB( DB_MASTER );
829894 $dbw->update( 'flaggedrevs',
830 - array('fr_namespace' => $newtitle->getNamespace(), 'fr_title' => $newtitle->getDBkey() ),
831 - array('fr_namespace' => $oldtitle->getNamespace(), 'fr_title' => $oldtitle->getDBkey() ),
 895+ array('fr_namespace' => $newtitle->getNamespace(),
 896+ 'fr_title' => $newtitle->getDBkey() ),
 897+ array('fr_namespace' => $oldtitle->getNamespace(),
 898+ 'fr_title' => $oldtitle->getDBkey() ),
832899 __METHOD__ );
833900
834901 return true;
835902 }
 903+
 904+ public function deleteVisiblitySettings( $article, $user, $reason ) {
 905+ $dbw = wfGetDB( DB_MASTER );
 906+ $dbw->delete( 'flaggedpage_settings',
 907+ array('fps_page_id' => $article->getID() ),
 908+ __METHOD__ );
 909+ }
836910
837911 /**
838912 * Clears cache for a page when merges are done.
@@ -885,7 +959,7 @@
886960 if( !$this->isReviewable( $linksUpdate->mTitle ) )
887961 return true;
888962 # Check if this page has a stable version
889 - $sv = $this->getOverridingRev( $linksUpdate->mTitle, true, true );
 963+ $sv = $this->getStableRev( $linksUpdate->mTitle, true, true );
890964 if( !$sv )
891965 return true;
892966 # Parse the revision
@@ -1035,7 +1109,7 @@
10361110 if( !$wgReviewChangesAfterEdit || !$wgUser->isAllowed( 'review' ) )
10371111 return true;
10381112
1039 - $frev = $this->getOverridingRev( $article->getTitle() );
 1113+ $frev = $this->getStableRev( $article->getTitle() );
10401114 if( $frev ) {
10411115 $frev_id = $frev->fr_rev_id;
10421116 $extraq .= "oldid={$frev_id}&diff=cur&editreview=1";
@@ -1055,7 +1129,7 @@
10561130 if( !$wgUser->isAllowed( 'review') || !$wgRequest->getBool('editreview') || !$NewRev->isCurrent() )
10571131 return true;
10581132
1059 - $frev = $this->getOverridingRev( $diff->mTitle );
 1133+ $frev = $this->getStableRev( $diff->mTitle );
10601134 if( !$frev || $frev->fr_rev_id != $OldRev->getID() )
10611135 return true;
10621136
@@ -1091,7 +1165,7 @@
10921166 $prev_id = $article->mTitle->getPreviousRevisionID( $rev->getID() );
10931167 if( !$prev_id )
10941168 return true;
1095 - $frev = $this->getOverridingRev( $article->mTitle );
 1169+ $frev = $this->getStableRev( $article->mTitle );
10961170 # Is this an edit directly to the stable version?
10971171 if( is_null($frev) || $prev_id != $frev->fr_rev_id )
10981172 return true;
@@ -1252,6 +1326,8 @@
12531327
12541328 function pageOverride() { return false; }
12551329
 1330+ function showStableByDefault() { return false; }
 1331+
12561332 function setPageContent( $article, &$outputDone, &$pcache ) {}
12571333
12581334 function addToEditView( $editform ) {}
@@ -1260,15 +1336,13 @@
12611337
12621338 function setPermaLink( $sktmp, &$nav_urls, &$revid, &$revid ) {}
12631339
1264 - function setCurrentTab( $sktmp, &$content_actions ) {}
 1340+ function setActionTabs( $sktmp, &$content_actions ) {}
12651341
12661342 function addToHistLine( $row, &$s ) {}
12671343
12681344 function addQuickReview( $id=NULL, $out ) {}
12691345
1270 - function getLatestQualityRev() {}
1271 -
1272 - function getLatestStableRev() {}
 1346+ function addVisibilityLink( $out ) {}
12731347
12741348 #########
12751349
@@ -1280,26 +1354,41 @@
12811355 * for overriding by stable revisions?
12821356 */
12831357 function pageOverride() {
1284 - global $wgFlaggedRevsAnonOnly, $wgFlaggedRevsOverride, $wgFlaggedRevs,
 1358+ global $wgFlaggedRevsAnonOnly, $wgFlaggedRevs,
12851359 $wgTitle, $wgUser, $wgRequest, $action;
12861360 # This only applies to viewing content pages
12871361 if( $action !='view' || !$this->isReviewable( $wgTitle ) )
1288 - return;
 1362+ return false;
12891363 # Does not apply to diffs/old revisions
12901364 if( $wgRequest->getVal('oldid') || $wgRequest->getVal('diff') )
1291 - return;
 1365+ return false;
 1366+ # Get page config
 1367+ $config = $wgFlaggedRevs->getVisibilitySettings( $wgTitle );
12921368 # Does the stable version override the current one?
1293 - if( $wgFlaggedRevsOverride ) {
 1369+ if( $config['override'] ) {
12941370 # If $wgFlaggedRevsAnonOnly is set to false, stable version are only requested explicitly
12951371 if( $wgFlaggedRevsAnonOnly && $wgUser->isAnon() ) {
1296 - return !( $wgRequest->getIntOrNull('stable')===0 );
 1372+ return !( $wgRequest->getIntOrNull('stable') === 0 );
12971373 } else {
1298 - return ( $wgRequest->getIntOrNull('stable')===1 );
 1374+ return ( $wgRequest->getIntOrNull('stable') === 1 );
12991375 }
1300 - } else {
1301 - return !( $wgRequest->getIntOrNull('stable') !==1 );
 1376+ # We are explicity requesting the stable version?
 1377+ } else if( $wgRequest->getIntOrNull('stable') === 1 ) {
 1378+ return true;
13021379 }
 1380+ return false;
13031381 }
 1382+
 1383+ /**
 1384+ * Is this user shown the stable version by default for this page?
 1385+ */
 1386+ function showStableByDefault() {
 1387+ global $wgFlaggedRevsOverride, $wgFlaggedRevsAnonOnly, $wgUser;
 1388+
 1389+ $config = $this->getVisibilitySettings();
 1390+
 1391+ return ( $config['override'] && !($wgFlaggedRevsAnonOnly && !$wgUser->isAnon()) );
 1392+ }
13041393
13051394 /**
13061395 * Replaces a page with the last stable version if possible
@@ -1320,9 +1409,9 @@
13211410 $skin = $wgUser->getSkin();
13221411
13231412 $vis_id = $revid;
1324 - $tag = ''; $notes = '';
 1413+ $tag = $notes = '';
13251414 # Check the newest stable version...
1326 - $tfrev = $this->getOverridingRev( null, true );
 1415+ $tfrev = $this->getStableRev( null, true );
13271416 $simpleTag = false;
13281417 if( $wgRequest->getVal('diff') || $wgRequest->getVal('oldid') ) {
13291418 // Do not clutter up diffs any further...
@@ -1445,7 +1534,7 @@
14461535 # Set new body html text as that of now
14471536 $tag = '';
14481537 # Check the newest stable version
1449 - $tfrev = $this->getOverridingRev();
 1538+ $tfrev = $this->getStableRev();
14501539 if( is_object($tfrev) ) {
14511540 global $wgLang, $wgUser, $wgFlaggedRevsAutoReview;
14521541
@@ -1501,7 +1590,7 @@
15021591 # review a revision that parses out newer templates/images than what they saw.
15031592 # Revisions are always reviewed based on current templates/images.
15041593 if( $this->pageOverride() ) {
1505 - $tfrev = $this->getOverridingRev();
 1594+ $tfrev = $this->getStableRev();
15061595 if( $tfrev )
15071596 return true;
15081597 }
@@ -1510,12 +1599,25 @@
15111600 return true;
15121601 }
15131602
 1603+ function addVisibilityLink( $out ) {
 1604+ global $wgUser, $wgRequest, $action;
 1605+
 1606+ if( $action=='protect' || $action=='unprotect' ) {
 1607+ $title = SpecialPage::getTitleFor( 'Stabilization' );
 1608+ # Give a link to the page to configure the stable version
 1609+ $out->mBodytext = '<span class="plainlinks">' .
 1610+ wfMsgExt( 'revreview-visibility',array('parseinline'), $title->getPrefixedText() ) .
 1611+ '</span>' . $out->mBodytext;
 1612+ }
 1613+ return true;
 1614+ }
 1615+
15141616 function setPermaLink( $sktmp, &$nav_urls, &$revid, &$revid ) {
15151617 # Non-content pages cannot be validated
15161618 if( !$this->pageOverride() )
15171619 return true;
15181620 # Check for an overridabe revision
1519 - $tfrev = $this->getOverridingRev();
 1621+ $tfrev = $this->getStableRev();
15201622 if( !$tfrev )
15211623 return true;
15221624 # Replace "permalink" with an actual permanent link
@@ -1536,23 +1638,23 @@
15371639 return true;
15381640 }
15391641
1540 - function setCurrentTab( $sktmp, &$content_actions ) {
1541 - global $wgRequest, $wgUser, $action, $wgFlaggedRevsAnonOnly,
1542 - $wgFlaggedRevsOverride, $wgFlaggedRevTabs;
 1642+ function setActionTabs( $sktmp, &$content_actions ) {
 1643+ global $wgRequest, $wgUser, $action, $wgFlaggedRevsAnonOnly, $wgFlaggedRevTabs;
15431644 # Get the subject page, not all skins have it :(
15441645 if( !isset($sktmp->mTitle) )
15451646 return true;
15461647 $title = $sktmp->mTitle->getSubjectPage();
15471648 # Non-content pages cannot be validated
1548 - if( !$this->isReviewable( $title ) || !$title->exists() )
 1649+ if( !$this->isReviewable( $title ) || !$title->exists() )
15491650 return true;
15501651 $article = new Article( $title );
15511652 # If we are viewing a page normally, and it was overridden,
15521653 # change the edit tab to a "current revision" tab
1553 - $tfrev = $this->getOverridingRev();
 1654+ $tfrev = $this->getStableRev();
15541655 # No quality revs? Find the last reviewed one
1555 - if( !is_object($tfrev) )
 1656+ if( !is_object($tfrev) ) {
15561657 return true;
 1658+ }
15571659 /*
15581660 // If the stable version is the same is the current, move along...
15591661 if( $article->getLatest() == $tfrev->fr_rev_id ) {
@@ -1560,32 +1662,28 @@
15611663 }
15621664 */
15631665 # Be clear about what is being edited...
1564 - if( !$sktmp->mTitle->isTalkPage() && !($wgFlaggedRevsAnonOnly && !$wgUser->isAnon()) ) {
 1666+ if( !$sktmp->mTitle->isTalkPage() && $this->showStableByDefault() ) {
15651667 if( isset( $content_actions['edit'] ) )
15661668 $content_actions['edit']['text'] = wfMsg('revreview-edit');
15671669 if( isset( $content_actions['viewsource'] ) )
15681670 $content_actions['viewsource']['text'] = wfMsg('revreview-source');
15691671 }
1570 -
15711672 if( !$wgFlaggedRevTabs ) {
15721673 return true;
15731674 }
15741675 // We are looking at the stable version
15751676 if( $this->pageOverride() ) {
15761677 $new_actions = array(); $counter = 0;
1577 - # Straighten out order
 1678+ # Straighten out order, set the tab AFTER the main tab is set
15781679 foreach( $content_actions as $tab_action => $data ) {
15791680 if( $counter==1 ) {
1580 - # Set the tab AFTER the main tab is set
1581 - if( $wgFlaggedRevsOverride && !($wgFlaggedRevsAnonOnly && !$wgUser->isAnon()) ) {
 1681+ if( $this->showStableByDefault() ) {
15821682 $new_actions['current'] = array(
15831683 'class' => '',
15841684 'text' => wfMsg('revreview-current'),
15851685 'href' => $title->getLocalUrl( 'stable=0' )
15861686 );
15871687 } else {
1588 - # Add 'stable' tab if either $wgFlaggedRevsOverride is off,
1589 - # or this is a user viewing the page with $wgFlaggedRevsAnonOnly on
15901688 $new_actions['stable'] = array(
15911689 'class' => 'selected',
15921690 'text' => wfMsg('revreview-stable'),
@@ -1598,22 +1696,19 @@
15991697 }
16001698 # Reset static array
16011699 $content_actions = $new_actions;
1602 - } else if( $action !='view' || $wgRequest->getVal('oldid') || $sktmp->mTitle->isTalkPage() ) {
1603 - // We are looking at the talk page or diffs/hist/oldids
 1700+ } else if( $action !='view' || $sktmp->mTitle->isTalkPage() ) {
 1701+ // We are looking at the talk page or diffs/hist/oldids, or in edit mode
16041702 $new_actions = array(); $counter = 0;
1605 - # Straighten out order
 1703+ # Straighten out order, set the tab AFTER the main tab is set
16061704 foreach( $content_actions as $tab_action => $data ) {
16071705 if( $counter==1 ) {
1608 - # Set the tab AFTER the main tab is set
1609 - if( $wgFlaggedRevsOverride && !($wgFlaggedRevsAnonOnly && !$wgUser->isAnon()) ) {
 1706+ if( $this->showStableByDefault() ) {
16101707 $new_actions['current'] = array(
16111708 'class' => '',
16121709 'text' => wfMsg('revreview-current'),
16131710 'href' => $title->getLocalUrl( 'stable=0' )
16141711 );
16151712 } else {
1616 - # Add 'stable' tab if either $wgFlaggedRevsOverride is off,
1617 - # or this is a user viewing the page with $wgFlaggedRevsAnonOnly on
16181713 $new_actions['stable'] = array(
16191714 'class' => '',
16201715 'text' => wfMsg('revreview-stable'),
@@ -1629,19 +1724,16 @@
16301725 } else if( $wgFlaggedRevTabs ) {
16311726 // We are looking at the current revision
16321727 $new_actions = array(); $counter = 0;
1633 - # Straighten out order
 1728+ # Straighten out order, set the tab AFTER the main tab is set
16341729 foreach( $content_actions as $tab_action => $data ) {
16351730 if( $counter==1 ) {
1636 - # Set the tab AFTER the main tab is set
1637 - if( $wgFlaggedRevsOverride && !($wgFlaggedRevsAnonOnly && !$wgUser->isAnon()) ) {
 1731+ if( $this->showStableByDefault() ) {
16381732 $new_actions['current'] = array(
16391733 'class' => 'selected',
16401734 'text' => wfMsg('revreview-current'),
16411735 'href' => $title->getLocalUrl( 'stable=0' )
16421736 );
16431737 } else {
1644 - # Add 'stable' tab if either $wgFlaggedRevsOverride is off,
1645 - # or this is a user viewing the page with $wgFlaggedRevsAnonOnly on
16461738 $new_actions['stable'] = array(
16471739 'class' => '',
16481740 'text' => wfMsg('revreview-stable'),
@@ -1690,8 +1782,8 @@
16911783 }
16921784
16931785 function addQuickReview( $id=NULL, $out, $top=false ) {
1694 - global $wgOut, $wgTitle, $wgUser, $wgRequest,
1695 - $wgFlaggedRevsOverride, $wgFlaggedRevComments, $wgFlaggedRevsWatch;
 1786+ global $wgOut, $wgTitle, $wgUser, $wgRequest, $wgFlaggedRevComments,
 1787+ $wgFlaggedRevsWatch;
16961788 # User must have review rights
16971789 if( !$wgUser->isAllowed( 'review' ) )
16981790 return;
@@ -1798,135 +1890,50 @@
17991891 * Same params for the sake of inheritance
18001892 * @return Row
18011893 */
1802 - function getOverridingRev( $title = NULL, $getText=false, $forUpdate=false ) {
1803 - global $wgTitle;
 1894+ function getStableRev( $t=null, $getText=false, $forUpdate=false ) {
 1895+ global $wgTitle, $wgFlaggedRevs;
 1896+ # Cached results available?
 1897+ if( $getText ) {
 1898+ if( isset($this->stablerev) && isset($this->stablerev->fr_text) ) {
 1899+ return $this->stablerev;
 1900+ }
 1901+ } else {
 1902+ if( isset($this->stablerev) ) {
 1903+ return $this->stablerev;
 1904+ }
 1905+ }
18041906 # Get the content page, skip talk
18051907 $title = $wgTitle->getSubjectPage();
1806 -
1807 - if( !$forUpdate ) {
1808 - if( !$row = $this->getLatestQualityRev( $getText ) ) {
1809 - if( !$row = $this->getLatestStableRev( $getText ) ) {
1810 - $this->stablefound = false;
1811 - return null;
1812 - }
1813 - }
1814 - $this->stablefound = true;
1815 - $this->stablerev = $row;
1816 - return $row;
1817 - }
1818 - # Cached results available?
1819 - if( isset($this->stablefound) ) {
1820 - return ( $this->stablefound ) ? $this->stablerev : null;
1821 - }
1822 -
1823 - $selectColumns = array('fr_rev_id','fr_user','fr_timestamp','fr_comment','rev_timestamp');
1824 - if( $getText ) {
1825 - $selectColumns[] = 'fr_text';
1826 - $selectColumns[] = 'fr_flags';
1827 - }
1828 -
1829 - $dbw = wfGetDB( DB_MASTER );
1830 - $result = $dbw->select( array('page', 'flaggedrevs', 'revision'),
1831 - $selectColumns,
1832 - array('page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey(),
1833 - 'page_ext_stable = fr_rev_id', 'fr_rev_id = rev_id',
1834 - 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
1835 - __METHOD__,
1836 - array('LIMIT' => 1) );
18371908 # Do we have one?
1838 - if( $row = $dbw->fetchObject($result) ) {
1839 - $this->stablefound = true;
 1909+ $row = $this->getStablePageRev( $title, $getText, $forUpdate );
 1910+ if( $row ) {
18401911 $this->stablerev = $row;
18411912 return $row;
18421913 } else {
1843 - $this->stablefound = false;
 1914+ $this->stablerev = null;
18441915 return null;
18451916 }
1846 -
1847 - return $row;
18481917 }
1849 -
1850 - /**
1851 - * Get latest flagged revision that meets requirments
1852 - * per the $wgFlaggedRevTags variable
1853 - * This passes rev_deleted revisions
1854 - * This is based on the current article and caches results
1855 - * @output array ( rev, flags )
1856 - */
1857 - function getLatestQualityRev( $getText=false ) {
1858 - global $wgTitle;
1859 - # Get the content page, skip talk
1860 - $title = $wgTitle->getSubjectPage();
 1918+
 1919+ /**
 1920+ * Get visiblity restrictions on page
 1921+ * Same params for the sake of inheritance
 1922+ * @returns Array
 1923+ */
 1924+ public function getVisibilitySettings( $t=null, $forUpdate=false ) {
 1925+ global $wgTitle;
18611926 # Cached results available?
1862 - if( isset($this->qualityfound) ) {
1863 - return ( $this->qualityfound ) ? $this->qualityrev : null;
 1927+ if( isset($this->pageconfig) ) {
 1928+ return $this->pageconfig;
18641929 }
1865 -
1866 - $selectColumns = array('fr_rev_id','fr_user','fr_timestamp','fr_comment','rev_timestamp');
1867 - if( $getText ) {
1868 - $selectColumns[] = 'fr_text';
1869 - $selectColumns[] = 'fr_flags';
1870 - }
1871 -
1872 - $dbr = wfGetDB( DB_SLAVE );
1873 - $result = $dbr->select( array('flaggedrevs', 'revision'),
1874 - $selectColumns,
1875 - array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), 'fr_quality >= 1',
1876 - 'fr_rev_id = rev_id', 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
1877 - __METHOD__,
1878 - array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1) );
1879 -
1880 - // Do we have one?
1881 - if( $row = $dbr->fetchObject($result) ) {
1882 - $this->qualityfound = true;
1883 - $this->qualityrev = $row;
1884 - return $row;
1885 - } else {
1886 - $this->qualityfound = false;
1887 - return null;
1888 - }
1889 - }
1890 -
1891 - /**
1892 - * Get latest flagged revision
1893 - * This passes rev_deleted revisions
1894 - * This is based on the current article and caches results
1895 - * The cache here doesn't make sense for arbitrary articles
1896 - * @output array ( rev, flags )
1897 - */
1898 - function getLatestStableRev( $getText=false ) {
1899 - global $wgTitle;
19001930 # Get the content page, skip talk
19011931 $title = $wgTitle->getSubjectPage();
1902 - # Cached results available?
1903 - if( isset($this->latestfound) ) {
1904 - return ( $this->latestfound ) ? $this->latestrev : NULL;
1905 - }
19061932
1907 - $selectColumns = array('fr_rev_id','fr_user','fr_timestamp','fr_comment','rev_timestamp');
1908 - if( $getText ) {
1909 - $selectColumns[] = 'fr_text';
1910 - $selectColumns[] = 'fr_flags';
1911 - }
 1933+ $config = $this->getPageVisibilitySettings( $title, $forUpdate );
 1934+ $this->pageconfig = $config;
19121935
1913 - $dbr = wfGetDB( DB_SLAVE );
1914 - $result = $dbr->select( array('flaggedrevs', 'revision'),
1915 - $selectColumns,
1916 - array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(),
1917 - 'fr_rev_id = rev_id', 'rev_page' => $title->getArticleID(),
1918 - 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
1919 - __METHOD__,
1920 - array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1) );
1921 - # Do we have one?
1922 - if( $row = $dbr->fetchObject($result) ) {
1923 - $this->latestfound = true;
1924 - $this->latestrev = $row;
1925 - return $row;
1926 - } else {
1927 - $this->latestfound = false;
1928 - return null;
1929 - }
1930 - }
 1936+ return $config;
 1937+ }
19311938
19321939 /**
19331940 * @param int $rev_id
@@ -1960,5 +1967,3 @@
19611968 }
19621969
19631970 }
1964 -
1965 -
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.sql
@@ -19,13 +19,26 @@
2020 fr_text mediumblob NOT NULL default '',
2121 -- Comma-separated list of flags:
2222 -- gzip: text is compressed with PHP's gzdeflate() function.
 23+ -- utf8: in UTF-8
2324 fr_flags tinyblob NOT NULL,
2425
2526 PRIMARY KEY (fr_namespace,fr_title,fr_rev_id),
26 - UNIQUE KEY (fr_rev_id),
27 - INDEX namespace_title_qal_rev (fr_namespace,fr_title,fr_quality,fr_rev_id)
 27+ UNIQUE KEY (fr_rev_id)
2828 ) TYPE=InnoDB;
2929
 30+-- This stores settings on how to select the default revision
 31+CREATE TABLE /*$wgDBprefix*/flaggedpages (
 32+ fp_page_id int(10) NOT NULL,
 33+ -- Integers to represent what to show by default:
 34+ -- 0: quality -> stable -> current
 35+ -- 1: latest reviewed
 36+ fp_select int(10) NOT NULL,
 37+ -- Override the page?
 38+ fp_override bool NOT NULL,
 39+
 40+ PRIMARY KEY (fps_page_id)
 41+) TYPE=InnoDB;
 42+
3043 -- This stores all of our tag data
3144 -- These are attached to specific flagged revisions
3245 CREATE TABLE /*$wgDBprefix*/flaggedrevtags (
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php
@@ -537,13 +537,12 @@
538538 global $wgOut, $wgTitle, $wgScript;
539539
540540 $encPage = str_replace( '_', ' ', $this->target );
541 - $encId = $this->oldid;
542541
543542 $form = "<form name='stableversions' action='$wgScript' method='get'>";
544543 $form .= "<fieldset><legend>".wfMsg('stableversions-leg1')."</legend>";
545544 $form .= "<table><tr>";
546545 $form .= "<td>".Xml::hidden( 'title', $wgTitle->getPrefixedText() )."</td>";
547 - $form .= "<td>".wfMsgHtml("stableversions-page").":</td>";
 546+ $form .= "<td>".wfMsgHtml("stableversions-page")."</td>";
548547 $form .= "<td>".Xml::input('page', 40, $encPage, array( 'id' => 'page' ) )."</td>";
549548 $form .= "<td>".wfSubmitButton( wfMsgHtml( 'go' ) )."</td>";
550549 $form .= "</tr></table>";
@@ -836,3 +835,171 @@
837836 return( "{$link} {$stxt} {$review}" );
838837 }
839838 }
 839+
 840+class Stabilization extends SpecialPage
 841+{
 842+
 843+ function Stabilization() {
 844+ SpecialPage::SpecialPage('Stabilization','stablesettings');
 845+ }
 846+
 847+ function execute( $par ) {
 848+ global $wgRequest, $wgUser, $wgOut;
 849+
 850+ $confirm = $wgRequest->wasPosted() &&
 851+ $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
 852+ $this->isAllowed = $wgUser->isAllowed( 'stablesettings' );
 853+ # Let anyone view, but not submit...
 854+ if( $wgRequest->wasPosted() ) {
 855+ if( $wgUser->isBlocked( !$confirm ) ) {
 856+ $wgOut->blockedPage();
 857+ return;
 858+ } else if( !$this->isAllowed ) {
 859+ $wgOut->permissionRequired( 'stablesettings' );
 860+ return;
 861+ } else if( wfReadOnly() ) {
 862+ $wgOut->readOnlyPage();
 863+ return;
 864+ }
 865+ }
 866+
 867+ $this->setHeaders();
 868+ $this->skin = $wgUser->getSkin();
 869+ # Our target page
 870+ $this->target = $wgRequest->getText( 'page' );
 871+ $this->page = Title::newFromUrl( $this->target );
 872+ # Params
 873+ $this->select = $wgRequest->getInt( 'select' );
 874+ $this->override = intval( $wgRequest->getBool( 'override' ) );
 875+ $this->comment = $wgRequest->getVal( 'wpReason' );
 876+
 877+ $this->showForm( $wgRequest );
 878+ # Only 0 or 1
 879+ if( $this->select && ($this->select !==0 && $this->select !==1) ) {
 880+ return;
 881+ }
 882+ # We need a page...
 883+ if( is_null($this->page) ) {
 884+ return;
 885+ }
 886+ # And it must actually be there...
 887+ if( !$this->page->exists() ) {
 888+ $wgOut->addHTML( wfMsgExt( 'stabilization-dne', array('parseinline'),
 889+ $this->page->getPrefixedText() ) );
 890+ return;
 891+ }
 892+
 893+ if( $confirm ) {
 894+ $this->submit();
 895+ } else {
 896+ $this->showSettings( $wgRequest );
 897+ }
 898+ }
 899+
 900+ function showForm( $wgRequest ) {
 901+ global $wgOut, $wgTitle, $wgScript;
 902+
 903+ $encPage = str_replace( '_', ' ', $this->target );
 904+ $form = "<form name='stabilization' action='$wgScript' method='get'>";
 905+ $form .= "<fieldset><legend>".wfMsg('stabilization-leg')."</legend>";
 906+ $form .= "<table><tr>";
 907+ $form .= "<td>".Xml::hidden( 'title', $wgTitle->getPrefixedText() )."</td>";
 908+ $form .= "<td>".wfMsgHtml("stabilization-page")."</td>";
 909+ $form .= "<td>".Xml::input('page', 40, $encPage, array( 'id' => 'page' ) )."</td>";
 910+ $form .= "<td>".wfSubmitButton( wfMsgHtml( 'go' ) )."</td>";
 911+ $form .= "</tr></table>";
 912+ $form .= "</fieldset></form>\n";
 913+
 914+ $wgOut->addHTML( $form );
 915+ }
 916+
 917+ function showSettings() {
 918+ global $wgOut, $wgScript, $wgTitle, $wgUser, $wgFlaggedRevs;
 919+ // Must be a content page
 920+ if( !$wgFlaggedRevs->isReviewable( $this->page ) ) {
 921+ $wgOut->addHTML( wfMsgExt('stableversions-none', array('parse'),
 922+ $this->page->getPrefixedText() ) );
 923+ return;
 924+ }
 925+ // Get visiblity settings...
 926+ $config = $wgFlaggedRevs->getVisibilitySettings( $this->page, true );
 927+ $encselect = $this->select ? $this->select : $config['select'];
 928+ $encoverride = $this->override ? $this->override : $config['override'];
 929+
 930+ if( !$this->isAllowed ) {
 931+ $form = '<p>'.wfMsgExt( 'stabilization-perm', array('parse'), $this->page->getPrefixedText() ).'</p>';
 932+ $off = array('disabled' => 'true');
 933+ } else {
 934+ $form = wfMsgExt( 'stabilization-text', array('parse'), $this->page->getPrefixedText() );
 935+ $off = array();
 936+ }
 937+
 938+ $form .= "<form name='stabilization' action='$wgScript' method='post'>";
 939+ $form .= "<fieldset><legend>".wfMsg('stabilization-select')."</legend>";
 940+ $form .= "<table><tr>";
 941+
 942+ $form .= "<td>".Xml::radio( 'select', 0, (0==$encselect), array('id' => 'select1') + $off )."</td>";
 943+ $form .= "<td>".Xml::label( wfMsg('stabilization-select1'), 'select1' )."</td>";
 944+ $form .= "</tr><tr>";
 945+ $form .= "<td>".Xml::radio( 'select', 1, (1==$encselect), array('id' => 'select2') + $off )."</td>";
 946+ $form .= "<td>".Xml::label( wfMsg('stabilization-select2'), 'select2' )."</td>";
 947+ $form .= "</tr></table></fieldset>";
 948+
 949+ $form .= "<fieldset><legend>".wfMsg('stabilization-def')."</legend>";
 950+ $form .= "<table><tr>";
 951+ $form .= "<td>".Xml::radio( 'override', 1, (1==$encoverride), array('id' => 'default1') + $off)."</td>";
 952+ $form .= "<td>".Xml::label( wfMsg('stabilization-def1'), 'default1' )."</td>";
 953+ $form .= "</tr><tr>";
 954+ $form .= "<td>".Xml::radio( 'override', 0, (0==$encoverride), array('id' => 'default2') + $off)."</td>";
 955+ $form .= "<td>".Xml::label( wfMsg('stabilization-def2'), 'default2' )."</td>";
 956+ $form .= "</tr></table></fieldset>";
 957+
 958+ $form .= Xml::hidden('title', $wgTitle->getPrefixedText() );
 959+ $form .= Xml::hidden('page', $this->page->getPrefixedText() );
 960+ $form .= wfHidden( 'wpEditToken', $wgUser->editToken() );
 961+
 962+ $form .= '<p>'.wfInputLabel( wfMsgHtml( 'revreview-log' ), 'wpReason', 'wpReason', 60 ).'</p>';
 963+ $form .= wfSubmitButton( wfMsgHtml( 'stabilization-submit' ) );
 964+ $form .= '</form>';
 965+
 966+ $wgOut->addHTML( $form );
 967+ }
 968+
 969+ function submit() {
 970+ global $wgOut, $wgFlaggedRevs;
 971+ # Get current config
 972+ $config = $wgFlaggedRevs->getVisibilitySettings( $this->page, true );
 973+
 974+ $comment = $this->comment;
 975+
 976+ $dbw = wfGetDB( DB_MASTER );
 977+ $success = $dbw->replace( 'flaggedpages',
 978+ array( 'fp_page_id' ),
 979+ array( 'fp_page_id' => $this->page->getArticleID(),
 980+ 'fp_select' => $this->select,
 981+ 'fp_override' => $this->override ),
 982+ __METHOD__ );
 983+
 984+ $wgOut->addHTML( wfMsgExt('stabilization-success',array('parse'),
 985+ $this->page->getPrefixedText() ) );
 986+ # Log if changed
 987+ if( $config['select'] != $this->select || $config['override'] != $this->override ) {
 988+ $log = new LogPage( 'review' );
 989+ // ID, accuracy, depth, style
 990+ $set = array();
 991+ $set[] = wfMsg( "stabilization-sel-short" ) . ": " .
 992+ wfMsg("stabilization-sel-short-{$this->select}");
 993+ $set[] = wfMsg( "stabilization-def-short" ) . ": " .
 994+ wfMsg("stabilization-def-short-{$this->override}");
 995+
 996+ $settings = ' [' . implode(', ',$set). ']';
 997+ // Append comment with action
 998+ // FIXME: do this better
 999+ $comment = ($comment) ? "$comment$settings" : "$settings";
 1000+
 1001+ $log->addEntry( 'config', $this->page, $comment );
 1002+ }
 1003+ // Update the page rows and the stable version
 1004+ $wgFlaggedRevs->articleLinksUpdate2( $this->page );
 1005+ }
 1006+}
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -61,13 +61,14 @@
6262 'hist-stable' => '[sighted]',
6363 'hist-quality' => '[quality]',
6464
65 - 'flaggedrevs' => 'Flagged Revisions',
66 - 'review-logpage' => 'Article review log',
67 - 'review-logpagetext' => 'This is a log of changes to revisions\' [[Help:Article validation|approval]] status
 65+ 'flaggedrevs' => 'Flagged Revisions',
 66+ 'review-logpage' => 'Article review log',
 67+ 'review-logpagetext' => 'This is a log of changes to revisions\' [[Help:Article validation|approval]] status
6868 for content pages.',
69 - 'review-logentrygrant' => 'reviewed $1',
70 - 'review-logentryrevoke' => 'depreciated a version of $1',
71 - 'review-logaction' => 'revision ID $1',
 69+ 'review-logentry-app' => 'reviewed $1',
 70+ 'review-logentry-dis' => 'depreciated a version of $1',
 71+ 'review-logentry-conf' => 'set stable version settings for $1',
 72+ 'review-logaction' => 'revision ID $1',
7273
7374 'revisionreview' => 'Review revisions',
7475 'revreview-main' => 'You must select a particular revision from a content page in order to review.
@@ -108,7 +109,7 @@
109110
110111 'stableversions' => 'Stable versions',
111112 'stableversions-leg1' => 'List reviewed revisions for a page',
112 - 'stableversions-page' => 'Page name',
 113+ 'stableversions-page' => 'Page name:',
113114 'stableversions-none' => '"[[:$1]]" has no reviewed revisions.',
114115 'stableversions-list' => 'The following is a list of revisions of "[[:$1]]" that have been reviewed:',
115116 'stableversions-review' => 'Reviewed on <i>$1</i> by $2',
@@ -122,6 +123,32 @@
123124 'unreviewed-category' => 'Category:',
124125 'unreviewed-diff' => 'Changes',
125126 'unreviewed-list' => 'This page lists articles that have not been reviewed or have new, unreviewed, revisions.',
 127+
 128+ 'revreview-visibility' => 'This page has a [[Help:Article validation|stable version]], which can be
 129+ [{{fullurl:Special:Stabilization|page={{FULLPAGENAMEE}}}} configured].',
 130+
 131+ 'stabilization' => 'Page stabilization',
 132+ 'stabilization-text' => 'Change the settings below to adjust how the stable version of [[:$1|$1]] is selected and displayed.',
 133+ 'stabilization-perm' => 'Your account does not have permission to change the stable version configuration.
 134+ Here are the current settings for [[:$1|$1]]:',
 135+ 'stabilization-page' => 'Page name:',
 136+ 'stabilization-leg' => 'Configure the stable version for a page',
 137+ 'stabilization-select' => 'How the stable version is selected:',
 138+ 'stabilization-select1' => 'The latest quality revision; if not present, then the latest reviewed one',
 139+ 'stabilization-select2' => 'The latest reviewed revision',
 140+ 'stabilization-def' => 'Revision displayed on default page view:',
 141+ 'stabilization-def1' => 'The stable revision',
 142+ 'stabilization-def2' => 'The current revision',
 143+ 'stabilization-submit' => 'Confirm',
 144+ 'stabilization-dne' => 'There is no page called "[[:$1|$1]]". No configuration possible.',
 145+ 'stabilization-success' => 'Stable version configuration for [[:$1|$1]] successfuly set.',
 146+
 147+ 'stabilization-sel-short' => 'Precedence',
 148+ 'stabilization-sel-short-0' => 'Quality',
 149+ 'stabilization-sel-short-1' => 'None',
 150+ 'stabilization-def-short' => 'Default',
 151+ 'stabilization-def-short-0' => 'Current',
 152+ 'stabilization-def-short-1' => 'Stable',
126153 );
127154
128155 /* Arabic (Meno25) */
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.pg.sql
@@ -16,6 +16,12 @@
1717 );
1818 CREATE INDEX fr_namespace_title ON flaggedrevs (fr_namespace,fr_title,fr_quality,fr_rev_id);
1919
 20+CREATE TABLE flaggedpages (
 21+ fp_page_id INTEGER NOT NULL PRIMARY KEY DEFAULT 0,
 22+ fp_select INTEGER NOT NULL DEFAULT 0,
 23+ fp_override bool NOT NULL
 24+)
 25+
2026 CREATE TABLE flaggedrevtags (
2127 frt_rev_id INTEGER NOT NULL DEFAULT 0 ,
2228 frt_dimension TEXT NOT NULL DEFAULT '',

Status & tagging log