You need to sign in or sign up before continuing.
search_plugin.cgi 928 Bytes
Newer Older
1
#!/usr/bin/perl -wT
2 3 4
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
#
6 7
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
8 9

use strict;
10
use lib qw(. lib);
11 12

use Bugzilla;
13
use Bugzilla::Error;
14
use Bugzilla::Constants;
15 16 17 18 19

Bugzilla->login();

my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
20
my $vars = {};
21 22 23 24

# Return the appropriate HTTP response headers.
print $cgi->header('application/xml');

25 26 27 28 29 30 31 32 33
# Get the contents of favicon.ico
my $filename = bz_locations()->{'libpath'} . "/images/favicon.ico";
if (open(IN, $filename)) {
    local $/;
    binmode IN;
    $vars->{'favicon'} = <IN>;
    close IN;
}
$template->process("search/search-plugin.xml.tmpl", $vars)
34
  || ThrowTemplateError($template->error());