Use CSS columns instead of tables in Special:SpecialPages
[lhc/web/wiklou.git] / opensearch_desc.php
index cb8b1be..5e5e35d 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  */
 
-require_once( __DIR__ . '/includes/WebStart.php' );
+require_once __DIR__ . '/includes/WebStart.php';
 
 if ( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
        // Makes testing tweaks about a billion times easier
@@ -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