=back
+=head2 buglist_format
+
+This happens in F<buglist.cgi>, used to change the template variables before
+processing the associated template hook.
+
+Params:
+
+=over
+
+=item C<vars>
+
+This is the entire set of variables that the current template
+can see.
+
+=item C<file>
+
+The name of the template file being processed. This is
+relative to the main template directory for the language (i.e. for
+F<template/en/default/list/list.html.tmpl>, this variable will contain
+C<list/list.html.tmpl>).
+
+=item C<params>
+
+A hashref. The set of named parameters extracted from cgi.
+
+=back
+
=head2 search_operator_field_override
This allows you to modify L<Bugzilla::Search/OPERATOR_FIELD_OVERRIDE>,
=back
+=head2 query_default_list
+
+This happens in F<query.cgi>, used to include additional cgi params to be
+searched for in order to create the set of default values.
+
+Params:
+
+=over
+
+=item C<list>
+
+The current list of cgi params to search for.
+
+=back
+
+=head2 query_format
+
+This happens in F<query.cgi>, used to to add/modify $vars before
+processing the template. For example, one could supply or modify the
+default values for a custom query format.
+
+Params:
+
+=over
+
+=item C<vars>
+
+This is the entire set of variables that the current template
+can see.
+
+=item C<file>
+
+The name of the template file being processed. This is
+relative to the main template directory for the language (i.e. for
+F<template/en/default/list/list.html.tmpl>, this variable will contain
+C<list/list.html.tmpl>).
+
+=back
+
=head2 quicksearch_map
This hook allows you to alter the Quicksearch syntax to include e.g. special
use Bugzilla::Field;
use Bugzilla::Status;
use Bugzilla::Token;
+use Bugzilla::Hook;
use Date::Parse;
# Determine the format in which the user would like to receive the output.
# Uses the default format if the user did not specify an output format;
# otherwise validates the user's choice against the list of available formats.
-my $format = $template->get_format("list/list", scalar $cgi->param('format'),
- scalar $cgi->param('ctype'));
+my $format = $template->get_format("list/list", scalar $params->param('format'),
+ scalar $params->param('ctype'));
# Use server push to display a "Please wait..." message for the user while
# executing their query if their browser supports it and they are viewing
# Content Generation
################################################################################
+Bugzilla::Hook::process("buglist_format", {'vars' => $vars,
+ 'format' => $format,
+ 'params' => $params});
+
# Generate and return the UI (HTML page) from the appropriate template.
$template->process($format->{'template'}, $vars)
|| ThrowTemplateError($template->error());
};
}
+sub buglist_format {
+ my ($self, $args) = @_;
+ my $vars = $args->{'vars'};
+ my $format = $args->{'format'};
+ my $params = $args->{'params'};
+
+ if ($format->{'template'} eq "list/list-example.html.tmpl") {
+ $vars->{'example'} = $params->param('example');
+ }
+}
+
sub search_operator_field_override {
my ($self, $args) = @_;
}
}
+sub query_format {
+ my ($self, $args) = @_;
+ my $vars = $args->{'vars'};
+ my $default = $vars->{'default'};
+ my $format = $args->{'format'};
+
+ # change some default values
+ if ($format->{'template'} eq "search/search-example.html.tmpl") {
+ $default->{'example'}[0] = $default->{'example'}[0] || "example";
+ }
+}
+
sub quicksearch_map {
my ($self, $args) = @_;
my $map = $args->{'map'};
$vars->{'query_format'} || $vars->{'format'},
scalar $cgi->param('ctype'));
+Bugzilla::Hook::process("query_format", {'vars' => $vars, 'format' => $format});
+
print $cgi->header($format->{'ctype'});
$template->process($format->{'template'}, $vars)