Merge "SpecialTrackingCategories: Read from the extension registry"
[lhc/web/wiklou.git] / includes / specials / SpecialWhatlinkshere.php
index 0986103..bbc111f 100644 (file)
@@ -509,6 +509,24 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                );
        }
 
+       /**
+        * 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 ) {
+               if ( $search === '' ) {
+                       return array();
+               }
+               // Autocomplete subpage the same as a normal search
+               $prefixSearcher = new StringPrefixSearch;
+               $result = $prefixSearcher->search( $search, $limit, array(), $offset );
+               return $result;
+       }
+
        protected function getGroupName() {
                return 'pagetools';
        }