From: Albert Ting Date: Sat, 16 Feb 2013 22:44:08 +0000 (+0100) Subject: Bug 836436: Add a "search_tabs" hook to allow additional search tabs X-Git-Tag: bugzilla-4.5.1~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=331fee414c98ff0eda46173bf2ebb700295461e7;p=thirdparty%2Fbugzilla.git Bug 836436: Add a "search_tabs" hook to allow additional search tabs r/a=LpSolit --- diff --git a/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl b/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl new file mode 100644 index 0000000000..c40cb6e5e1 --- /dev/null +++ b/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl @@ -0,0 +1,13 @@ +[%# 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/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% + tabs.push ({ name => 'newsearch', label => "New Search", + link => "query.cgi?format=newsearch" }) +%] + diff --git a/template/en/default/search/tabs.html.tmpl b/template/en/default/search/tabs.html.tmpl index f7703fd929..74569dceb7 100644 --- a/template/en/default/search/tabs.html.tmpl +++ b/template/en/default/search/tabs.html.tmpl @@ -10,11 +10,15 @@ # This template has no interface. #%] +[% tabs = [ { name => 'specific', label => "Simple Search", + link => "query.cgi?format=specific" }, + { name => 'advanced', label => "Advanced Search", + link => "query.cgi?format=advanced" } ] %] + +[% Hook.process('search_tabs') %] + [% WRAPPER global/tabs.html.tmpl - tabs = [ { name => 'specific', label => "Simple Search", - link => "query.cgi?format=specific" }, - { name => 'advanced', label => "Advanced Search", - link => "query.cgi?format=advanced" } ] + tabs = tabs current_tab_name = query_format || format || "advanced" %]