r68623 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68622‎ | r68623 | r68624 >
Date:07:17, 27 June 2010
Author:demon
Status:ok
Tags:
Comment:
(bug 23989 pt 2), also add indef expiry checkbox to Special:StablePages
Modified paths:
  • /trunk/extensions/FlaggedRevs/language/StablePages.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/StablePages.i18n.php
@@ -14,6 +14,7 @@
1515 Edits made by other users are not displayed to readers by default until an authorized user reviews them.',
1616 'stablepages-none' => 'There are no pages in this list.',
1717 'stablepages-config' => 'Configuration',
 18+ 'stablepages-indef' => 'Indefinite expiry only',
1819 );
1920
2021 /** Message documentation (Message documentation)
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -19,6 +19,7 @@
2020
2121 $this->namespace = $wgRequest->getIntOrNull( 'namespace' );
2222 $this->autoreview = $wgRequest->getVal( 'restriction', '' );
 23+ $this->indef = $wgRequest->getBool( 'indef', false );
2324
2425 $this->showForm();
2526 $this->showPageList();
@@ -36,6 +37,8 @@
3738 if( FlaggedRevs::getRestrictionLevels() ) {
3839 $fields[] = FlaggedRevsXML::getRestrictionFilterMenu( $this->autoreview );
3940 }
 41+ $fields[] = Xml::checkLabel( wfMsg( 'stablepages-indef' ), 'indef',
 42+ 'stablepages-indef', $this->indef );
4043 if ( count( $fields ) ) {
4144 $form = Xml::openElement( 'form',
4245 array( 'name' => 'stablepages', 'action' => $wgScript, 'method' => 'get' ) );
@@ -51,7 +54,7 @@
5255
5356 protected function showPageList() {
5457 global $wgOut;
55 - $pager = new StablePagesPager( $this, array(), $this->namespace, $this->autoreview );
 58+ $pager = new StablePagesPager( $this, array(), $this->namespace, $this->autoreview, $this->indef );
5659 if ( $pager->getNumRows() ) {
5760 $wgOut->addHTML( $pager->getNavigationBar() );
5861 $wgOut->addHTML( $pager->getBody() );
@@ -109,9 +112,10 @@
110113
111114 // @param int $namespace (null for "all")
112115 // @param string $autoreview ('' for "all", 'none' for no restriction)
113 - function __construct( $form, $conds = array(), $namespace, $autoreview ) {
 116+ function __construct( $form, $conds = array(), $namespace, $autoreview, $indef ) {
114117 $this->mForm = $form;
115118 $this->mConds = $conds;
 119+ $this->indef = $indef;
116120 # Must be content pages...
117121 $validNS = FlaggedRevs::getReviewNamespaces();
118122 if ( is_integer( $namespace ) ) {
@@ -144,8 +148,12 @@
145149 }
146150 $conds['page_namespace'] = $this->namespace;
147151 # Be sure not to include expired items
148 - $encCutoff = $this->mDb->addQuotes( $this->mDb->timestamp() );
149 - $conds[] = "fpc_expiry > {$encCutoff}";
 152+ if( $this->indef ) {
 153+ $conds['fpc_expiry'] = Block::infinity();
 154+ } else {
 155+ $encCutoff = $this->mDb->addQuotes( $this->mDb->timestamp() );
 156+ $conds[] = "fpc_expiry > {$encCutoff}";
 157+ }
150158 return array(
151159 'tables' => array( 'flaggedpage_config', 'page' ),
152160 'fields' => array( 'page_namespace', 'page_title', 'fpc_override',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68167(bug 23989) Add page history and stability log links to entries on Special:St...demon12:01, 17 June 2010

Status & tagging log