From 8762d1e68c4ea2343f445bb4beb46c1ae04586b1 Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Thu, 8 Jan 2015 12:49:25 -0500 Subject: Bug 832095 - Request new buglist/query hooks --- extensions/Example/Extension.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'extensions') diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index af36b107a..0ab5220a7 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -304,6 +304,17 @@ sub buglist_column_joins { }; } +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) = @_; @@ -856,6 +867,18 @@ sub product_end_of_create { } } +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'}; -- cgit v1.2.3-24-g4f1b