Merge "jquery.accessKeyLabel: make modifier info public"
[lhc/web/wiklou.git] / includes / specials / SpecialDeletedContributions.php
index 44352a7..f6d560f 100644 (file)
@@ -413,7 +413,8 @@ class DeletedContributionsPage extends SpecialPage {
                $target = $userObj->getName();
                $out->addSubtitle( $this->getSubTitle( $userObj ) );
 
-               if ( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
+               $ns = $request->getVal( 'namespace', null );
+               if ( $ns !== null && $ns !== '' ) {
                        $options['namespace'] = intval( $ns );
                } else {
                        $options['namespace'] = '';
@@ -657,6 +658,24 @@ class DeletedContributionsPage extends SpecialPage {
                return $f;
        }
 
+       /**
+        * 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';
        }