$columnlist = preg_grep( '/^img/', array_keys( $this->getFieldNames() ) );
$options = [ 'GROUP BY' => array_merge( [ 'img_user' ], $columnlist ) ];
- $join_conds = [ 'oldimage' => [ 'LEFT JOIN', 'oi_name = img_name' ] ];
+ $join_conds['oldimage'] = [ 'LEFT JOIN', 'oi_name = img_name' ];
}
return [
* @param {Array} filterStructure Filter definition and structure for the model
* @param {Object} [namespaceStructure] Namespace definition
* @param {Object} [tagList] Tag definition
+ * @param {Object} [conditionalViews] Conditional view definition
*/
- mw.rcfilters.Controller.prototype.initialize = function ( filterStructure, namespaceStructure, tagList ) {
+ mw.rcfilters.Controller.prototype.initialize = function ( filterStructure, namespaceStructure, tagList, conditionalViews ) {
var parsedSavedQueries, pieces,
displayConfig = mw.config.get( 'StructuredChangeFiltersDisplayConfig' ),
defaultSavedQueryExists = mw.config.get( 'wgStructuredChangeFiltersDefaultSavedQueryExists' ),
controller = this,
- views = {},
+ views = $.extend( true, {}, conditionalViews ),
items = [],
uri = new mw.Uri();
]
};
- views.recentChangesLinked = {
- groups: [
- {
- name: 'page',
- type: 'any_value',
- title: '',
- hidden: true,
- sticky: true,
- filters: [
- {
- name: 'target',
- 'default': ''
- }
- ]
- },
- {
- name: 'toOrFrom',
- type: 'boolean',
- title: '',
- hidden: true,
- sticky: true,
- filters: [
- {
- name: 'showlinkedto',
- 'default': false
- }
- ]
- }
- ]
- };
-
// Before we do anything, we need to see if we require additional items in the
// groups that have 'AllowArbitrary'. For the moment, those are only single_option
// groups; if we ever expand it, this might need further generalization:
topSection,
$watchlistDetails,
namespaces,
+ conditionalViews = {},
savedQueriesPreferenceName = mw.config.get( 'wgStructuredChangeFiltersSavedQueriesPreferenceName' ),
daysPreferenceName = mw.config.get( 'wgStructuredChangeFiltersDaysPreferenceName' ),
limitPreferenceName = mw.config.get( 'wgStructuredChangeFiltersLimitPreferenceName' ),
'.mw-changeslist-notargetpage'
].join( ', ' ) );
+ if ( specialPage === 'Recentchangeslinked' ) {
+ conditionalViews.recentChangesLinked = {
+ groups: [
+ {
+ name: 'page',
+ type: 'any_value',
+ title: '',
+ hidden: true,
+ isSticky: false,
+ filters: [
+ {
+ name: 'target',
+ 'default': ''
+ }
+ ]
+ },
+ {
+ name: 'toOrFrom',
+ type: 'boolean',
+ title: '',
+ hidden: true,
+ isSticky: false,
+ filters: [
+ {
+ name: 'showlinkedto',
+ 'default': false
+ }
+ ]
+ }
+ ]
+ };
+
+ }
+
// TODO: The changesListWrapperWidget should be able to initialize
// after the model is ready.
controller.initialize(
mw.config.get( 'wgStructuredChangeFilters' ),
namespaces,
- mw.config.get( 'wgRCFiltersChangeTags' )
+ mw.config.get( 'wgRCFiltersChangeTags' ),
+ conditionalViews
);
// eslint-disable-next-line no-new