X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=opensearch_desc.php;h=5e5e35d3334b1be37e63aac184df5ecbd3cd52a0;hb=f94e85e976e2fd5e326be2a103eaa682eda78b11;hp=ecd5051cd991b9c5a198db0533920db5df80b5bf;hpb=71c0d39d12f140eb49757c991e063daec34b000f;p=lhc%2Fweb%2Fwiklou.git diff --git a/opensearch_desc.php b/opensearch_desc.php index ecd5051cd9..5e5e35d333 100644 --- a/opensearch_desc.php +++ b/opensearch_desc.php @@ -78,13 +78,18 @@ $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