X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=blobdiff_plain;f=opensearch_desc.php;h=0b5697270a7a2be9546b011b0d5922cb44ae95c8;hb=f873b499650ef5d27570f9cb96d01d1477f9e089;hp=ecd5051cd991b9c5a198db0533920db5df80b5bf;hpb=703206f38c63ba51e75a8aa49724f112ab78047d;p=lhc%2Fweb%2Fwiklou.git diff --git a/opensearch_desc.php b/opensearch_desc.php index ecd5051cd9..0b5697270a 100644 --- a/opensearch_desc.php +++ b/opensearch_desc.php @@ -78,18 +78,23 @@ $urls[] = array( 'method' => 'get', 'template' => $searchPage->getCanonicalURL( 'search={searchTerms}' ) ); -if ( $wgEnableAPI ) { - // JSON interface for search suggestions. - // Supported in Firefox 2 and later. - $urls[] = array( - 'type' => 'application/x-suggestions+json', - 'method' => 'get', - 'template' => SearchEngine::getOpenSearchTemplate() ); +foreach ( $wgOpenSearchTemplates as $type => $template ) { + if ( !$template && $wgEnableAPI ) { + $template = ApiOpenSearch::getOpenSearchTemplate( $type ); + } + + if ( $template ) { + $urls[] = array( + 'type' => $type, + 'method' => 'get', + 'template' => $template, + ); + } } // Allow hooks to override the suggestion URL settings in a more // general way than overriding the whole search engine... -wfRunHooks( 'OpenSearchUrls', array( &$urls ) ); +Hooks::run( 'OpenSearchUrls', array( &$urls ) ); foreach ( $urls as $attribs ) { print Xml::element( 'Url', $attribs );