true
);
parent::execute( $subpage );
-
- if ( $this->isStructuredFilterUiEnabled() ) {
- $out->addJsConfigVars( 'wgStructuredChangeFiltersLiveUpdateSupported', true );
- }
}
/**
public function getDefaultOptions() {
$opts = parent::getDefaultOptions();
- $opts->add( 'days', $this->getDefaultDays(), FormOptions::FLOAT );
- $opts->add( 'limit', $this->getDefaultLimit() );
- $opts->add( 'from', '' );
-
$opts->add( 'categories', '' );
$opts->add( 'categories_any', false );
}
}
- public function validateOptions( FormOptions $opts ) {
- $opts->validateIntBounds( 'limit', 0, 5000 );
- $opts->validateBounds( 'days', 0, $this->getConfig()->get( 'RCMaxAge' ) / ( 3600 * 24 ) );
- parent::validateOptions( $opts );
- }
-
- /**
- * @inheritDoc
- */
- protected function buildQuery( &$tables, &$fields, &$conds,
- &$query_options, &$join_conds, FormOptions $opts
- ) {
- $dbr = $this->getDB();
- parent::buildQuery( $tables, $fields, $conds,
- $query_options, $join_conds, $opts );
-
- // Calculate cutoff
- $cutoff_unixtime = time() - $opts['days'] * 3600 * 24;
- $cutoff = $dbr->timestamp( $cutoff_unixtime );
-
- $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] );
- if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) {
- $cutoff = $dbr->timestamp( $opts['from'] );
- } else {
- $opts->reset( 'from' );
- }
-
- $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff );
- }
-
/**
* @inheritDoc
*/