X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fspecials%2FSpecialContributions.php;h=1a1b490c74b5425fc0c9ed2bc790aaaf8d340674;hb=f0207e8ca6e1e8fa41a768b825534572b59f08bc;hp=b1908c2fe45e5ed383093490ddee9099c88d08e6;hpb=25c9157bca911120b578ace6147582f37c04b333;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index b1908c2fe4..1a1b490c74 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -49,11 +49,7 @@ class SpecialContributions extends IncludableSpecialPage { $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 { @@ -482,7 +478,7 @@ class SpecialContributions extends IncludableSpecialPage { $filterSelection = Html::rawElement( 'td', array(), - implode( ' ', $tagFilter ) + implode( ' ', $tagFilter ) ); } else { $filterSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), '' ); @@ -575,8 +571,10 @@ class SpecialContributions extends IncludableSpecialPage { ) ); + $filters = array(); + if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) { - $deletedOnlyCheck = Html::rawElement( + $filters[] = Html::rawElement( 'span', array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( @@ -587,11 +585,9 @@ class SpecialContributions extends IncludableSpecialPage { array( 'class' => 'mw-input' ) ) ); - } else { - $deletedOnlyCheck = ''; } - $checkLabelTopOnly = Html::rawElement( + $filters[] = Html::rawElement( 'span', array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( @@ -602,7 +598,7 @@ class SpecialContributions extends IncludableSpecialPage { array( 'class' => 'mw-input' ) ) ); - $checkLabelNewOnly = Html::rawElement( + $filters[] = Html::rawElement( 'span', array( 'class' => 'mw-input-with-label' ), Xml::checkLabel( @@ -613,10 +609,16 @@ class SpecialContributions extends IncludableSpecialPage { 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 ), @@ -649,6 +651,24 @@ class SpecialContributions extends IncludableSpecialPage { 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'; }