$target = $request->getVal( 'target' );
}
- // check for radiobox
- if ( $request->getVal( 'contribs' ) == 'newbie' ) {
- $target = 'newbies';
- $this->opts['contribs'] = 'newbie';
- } elseif ( $par === 'newbies' ) { // b/c for WMF
+ if ( $request->getVal( 'contribs' ) == 'newbie' || $par === 'newbies' ) {
$target = 'newbies';
$this->opts['contribs'] = 'newbie';
} else {
$filterSelection = Html::rawElement(
'td',
array(),
- implode( ' ', $tagFilter )
+ implode( ' ', $tagFilter )
);
} else {
$filterSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), '' );
)
);
+ $filters = array();
+
if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
- $deletedOnlyCheck = Html::rawElement(
+ $filters[] = Html::rawElement(
'span',
array( 'class' => 'mw-input-with-label' ),
Xml::checkLabel(
array( 'class' => 'mw-input' )
)
);
- } else {
- $deletedOnlyCheck = '';
}
- $checkLabelTopOnly = Html::rawElement(
+ $filters[] = Html::rawElement(
'span',
array( 'class' => 'mw-input-with-label' ),
Xml::checkLabel(
array( 'class' => 'mw-input' )
)
);
- $checkLabelNewOnly = Html::rawElement(
+ $filters[] = Html::rawElement(
'span',
array( 'class' => 'mw-input-with-label' ),
Xml::checkLabel(
array( 'class' => 'mw-input' )
)
);
+
+ Hooks::run(
+ 'SpecialContributions::getForm::filters',
+ array( $this, &$filters )
+ );
+
$extraOptions = Html::rawElement(
'td',
array( 'colspan' => 2 ),
- $deletedOnlyCheck . $checkLabelTopOnly . $checkLabelNewOnly
+ implode( '', $filters )
);
$dateSelectionAndSubmit = Xml::tags( 'td', array( 'colspan' => 2 ),
return $form;
}
+ /**
+ * Return an array of subpages beginning with $search that this special page will accept.
+ *
+ * @param string $search Prefix to search for
+ * @param int $limit Maximum number of results to return (usually 10)
+ * @param int $offset Number of results to skip (usually 0)
+ * @return string[] Matching subpages
+ */
+ public function prefixSearchSubpages( $search, $limit, $offset ) {
+ $user = User::newFromName( $search );
+ if ( !$user ) {
+ // No prefix suggestion for invalid user
+ return array();
+ }
+ // Autocomplete subpage as user list - public to allow caching
+ return UserNamePrefixSearch::search( 'public', $search, $limit, $offset );
+ }
+
protected function getGroupName() {
return 'users';
}