public function execute( $subpage ) {
$this->rcSubpage = $subpage;
- $this->considerActionsForDefaultSavedQuery();
+ $this->considerActionsForDefaultSavedQuery( $subpage );
$opts = $this->getOptions();
try {
// Used by "live update" and "view newest" to check
// if there's new changes with minimal data transfer
if ( $this->getRequest()->getBool( 'peek' ) ) {
- $code = $rows->numRows() > 0 ? 200 : 204;
+ $code = $rows->numRows() > 0 ? 200 : 204;
$this->getOutput()->setStatusCode( $code );
+
+ if ( $this->getUser()->isAnon() !==
+ $this->getRequest()->getFuzzyBool( 'isAnon' )
+ ) {
+ $this->getOutput()->setStatusCode( 205 );
+ }
+
return;
}
* Check whether or not the page should load defaults, and if so, whether
* a default saved query is relevant to be redirected to. If it is relevant,
* redirect properly with all necessary query parameters.
+ *
+ * @param string $subpage
*/
- protected function considerActionsForDefaultSavedQuery() {
- if ( !$this->isStructuredFilterUiEnabled() ) {
+ protected function considerActionsForDefaultSavedQuery( $subpage ) {
+ if ( !$this->isStructuredFilterUiEnabled() || $this->including() ) {
return;
}
// but are still valid and requested in the URL
$query = array_merge( $this->getRequest()->getValues(), $query );
unset( $query[ 'title' ] );
- $this->getOutput()->redirect( $this->getPageTitle()->getCanonicalURL( $query ) );
+ $this->getOutput()->redirect( $this->getPageTitle( $subpage )->getCanonicalURL( $query ) );
} else {
// There's a default, but the version is not 2, and the server can't
// actually recognize the query itself. This happens if it is before
*/
protected function includeRcFiltersApp() {
$out = $this->getOutput();
- if ( $this->isStructuredFilterUiEnabled() ) {
+ if ( $this->isStructuredFilterUiEnabled() && !$this->including() ) {
$jsData = $this->getStructuredFilterJsData();
$messages = [];
# Collapsible
$collapsedState = $this->getRequest()->getCookie( 'changeslist-state' );
$collapsedClass = $collapsedState === 'collapsed' ? ' mw-collapsed' : '';
+ # Enhanced mode
+ $enhancedMode = $this->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
+ $enhancedClass = $enhancedMode ? ' mw-enhanced' : '';
+
+ $legendClasses = $collapsedClass . $enhancedClass;
$legend =
- '<div class="mw-changeslist-legend mw-collapsible' . $collapsedClass . '">' .
+ '<div class="mw-changeslist-legend mw-collapsible' . $legendClasses . '">' .
$legendHeading .
'<div class="mw-collapsible-content">' . $legend . '</div>' .
'</div>';
] );
$out->addModules( 'mediawiki.special.changeslist.legend.js' );
- if ( $this->isStructuredFilterUiEnabled() ) {
+ if ( $this->isStructuredFilterUiEnabled() && !$this->including() ) {
$out->addModules( 'mediawiki.rcfilters.filters.ui' );
$out->addModuleStyles( 'mediawiki.rcfilters.filters.base.styles' );
}
return true;
}
- return self::checkStructuredFilterUiEnabled(
+ return static::checkStructuredFilterUiEnabled(
$this->getConfig(),
$this->getUser()
);