Just another checkbox and option flag...
Bug: T16086
Change-Id: Iacc66213798fa527adc3346fe1763ab0e04d2afe
'deletedOnly' => $params['deletedonly'],
'topOnly' => $params['toponly'],
'newOnly' => $params['newonly'],
+ 'hideMinor' => $params['hideminor'],
'showSizeDiff' => $params['showsizediff'],
] );
'deletedonly' => false,
'toponly' => false,
'newonly' => false,
+ 'hideminor' => false,
'showsizediff' => [
ApiBase::PARAM_DFLT => false,
],
"apihelp-feedcontributions-param-deletedonly": "Show only deleted contributions.",
"apihelp-feedcontributions-param-toponly": "Only show edits that are latest revisions.",
"apihelp-feedcontributions-param-newonly": "Only show edits that are page creations.",
+ "apihelp-feedcontributions-param-hideminor": "Hide minor edits.",
"apihelp-feedcontributions-param-showsizediff": "Show the size difference between revisions.",
"apihelp-feedcontributions-example-simple": "Return contributions for user <kbd>Example</kbd>.",
"apihelp-feedcontributions-param-deletedonly": "{{doc-apihelp-param|feedcontributions|deletedonly}}",
"apihelp-feedcontributions-param-toponly": "{{doc-apihelp-param|feedcontributions|toponly}}",
"apihelp-feedcontributions-param-newonly": "{{doc-apihelp-param|feedcontributions|newonly}}",
+ "apihelp-feedcontributions-param-hideminor": "{{doc-apihelp-param|feedcontributions|hideminor}}",
"apihelp-feedcontributions-param-showsizediff": "{{doc-apihelp-param|feedcontributions|showsizediff}}",
"apihelp-feedcontributions-example-simple": "{{doc-apihelp-example|feedcontributions}}",
"apihelp-feedrecentchanges-description": "{{doc-apihelp-description|feedrecentchanges}}",
$this->opts['target'] = $target;
$this->opts['topOnly'] = $request->getBool( 'topOnly' );
$this->opts['newOnly'] = $request->getBool( 'newOnly' );
+ $this->opts['hideMinor'] = $request->getBool( 'hideMinor' );
$nt = Title::makeTitleSafe( NS_USER, $target );
if ( !$nt ) {
if ( $this->opts['newOnly'] ) {
$feedParams['newonly'] = true;
}
+ if ( $this->opts['hideMinor'] ) {
+ $feedParams['hideminor'] = true;
+ }
if ( $this->opts['deletedOnly'] ) {
$feedParams['deletedonly'] = true;
}
'deletedOnly' => $this->opts['deletedOnly'],
'topOnly' => $this->opts['topOnly'],
'newOnly' => $this->opts['newOnly'],
+ 'hideMinor' => $this->opts['hideMinor'],
'nsInvert' => $this->opts['nsInvert'],
'associated' => $this->opts['associated'],
] );
$this->opts['newOnly'] = false;
}
+ if ( !isset( $this->opts['hideMinor'] ) ) {
+ $this->opts['hideMinor'] = false;
+ }
+
$form = Html::openElement(
'form',
[
'month',
'topOnly',
'newOnly',
+ 'hideMinor',
'associated',
'tagfilter'
];
[ 'class' => 'mw-input' ]
)
);
+ $filters[] = Html::rawElement(
+ 'span',
+ [ 'class' => 'mw-input-with-label' ],
+ Xml::checkLabel(
+ $this->msg( 'sp-contributions-hideminor' )->text(),
+ 'hideMinor',
+ 'mw-hide-minor-edits',
+ $this->opts['hideMinor'],
+ [ 'class' => 'mw-input' ]
+ )
+ );
Hooks::run(
'SpecialContributions::getForm::filters',
$this->deletedOnly = !empty( $options['deletedOnly'] );
$this->topOnly = !empty( $options['topOnly'] );
$this->newOnly = !empty( $options['newOnly'] );
+ $this->hideMinor = !empty( $options['hideMinor'] );
$year = isset( $options['year'] ) ? $options['year'] : false;
$month = isset( $options['month'] ) ? $options['month'] : false;
$condition[] = 'rev_parent_id = 0';
}
+ if ( $this->hideMinor ) {
+ $condition[] = 'rev_minor_edit = 0';
+ }
+
return [ $tables, $index, $condition, $join_conds ];
}
"sp-contributions-username": "IP address or username:",
"sp-contributions-toponly": "Only show edits that are latest revisions",
"sp-contributions-newonly": "Only show edits that are page creations",
+ "sp-contributions-hideminor": "Hide minor edits",
"sp-contributions-submit": "Search",
"sp-contributions-explain": "",
"sp-contributions-footer": "-",
"sp-contributions-username": "This message appears whenever someone requests [[Special:Contributions]].\n{{Identical|IP address or username}}",
"sp-contributions-toponly": "A checkbox at [[Special:Mycontributions|Special:Contributions]]",
"sp-contributions-newonly": "Used as checkbox label at [[Special:Mycontributions|Special:Contributions]].\n\n\"page creation\" means the \"first revision\" of a page.\n\nPreceded by {{msg-mw|Sp-contributions-toponly}}.",
+ "sp-contributions-hideminor": "Used as checkbox label at [[Special:Mycontributions|Special:Contributions]].\n\nSee also:\n* {{msg-mw|Tog-hideminor}}",
"sp-contributions-submit": "{{Identical|Search}}",
"sp-contributions-explain": "{{optional}}",
"sp-contributions-footer": "{{ignored}}This is the footer for users that are not anonymous or newbie on [[Special:Contributions]].",