bug 1448: improve subject classification browser
[koha_fer] / opac / opac-search.pl
index 029ef1e..ae7f4ea 100755 (executable)
@@ -446,7 +446,7 @@ for (my $i=0;$i<=@servers;$i++) {
                foreach (@newresults) {
                    $_->{coins} = GetCOinSBiblio($_->{'biblionumber'});
                }
-      }
+      
        if ($results_hashref->{$server}->{"hits"}){
            $total = $total + $results_hashref->{$server}->{"hits"};
        }
@@ -610,15 +610,6 @@ if ( C4::Context->preference("kohaspsuggest") ) {
 }
 
 # VI. BUILD THE TEMPLATE
-# NOTE: not using application/atom+xml or application/rss+xml beccause of Internet Explorer 6;
-# see bug 2078.
-my $content_type;
-if ($cgi->param('format') && $cgi->param('format') =~ /rss|atom/ ){
-    $content_type = "application/xml";
-}
-else {
-    $content_type = "text/html";
-}
 # Build drop-down list for 'Add To:' menu...
 my $session = get_session($cgi->cookie("CGISESSID"));
 my @addpubshelves;
@@ -639,4 +630,14 @@ if (defined $barshelves) {
        $template->param( addbarshelvesloop => $barshelves);
 }
 
-output_html_with_http_headers $cgi, $cookie, $template->output, $content_type;
+my $content_type;
+
+if ($cgi->param('format') && $cgi->param('format') =~ /rss/) {
+    $content_type = 'rss'
+} elsif ($cgi->param('format') && $cgi->param('format') =~ /atom/) {
+    $content_type = 'atom'
+} else {
+    $content_type = 'html'
+}
+
+output_with_http_headers $cgi, $cookie, $template->output, $content_type;