Introduce SajaxSearch hook
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sat, 26 Jan 2008 19:27:19 +0000 (19:27 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sat, 26 Jan 2008 19:27:19 +0000 (19:27 +0000)
includes/AjaxFunctions.php

index 9704e83..50182d8 100644 (file)
@@ -79,6 +79,13 @@ function wfSajaxSearch( $term ) {
        global $wgContLang, $wgOut, $wgUser, $wgCapitalLinks, $wgMemc;
        $limit = 16;
        $sk = $wgUser->getSkin();
+       $output = '';
+
+       if( !wfRunHooks( 'SajaxSearch', array( $term, &$output ) ) ) {
+               $response = new AjaxResponse( $output );
+               $response->setCacheDuration( 30*60 );
+               return $response;
+       }
 
        $term = trim( $term );
        $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) );