summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrojanu <aliustek@gmail.com>2011-01-22 18:51:36 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-01-22 18:51:36 +0100
commit3ba91b28893ab0192f995067404c90f2143e425a (patch)
treea04643f48583f33307009bd31fd9fa157e30e1ee
parent721dfc64e95140c48726738770cd22b71ac36702 (diff)
downloadbugzilla-3ba91b28893ab0192f995067404c90f2143e425a.tar.gz
bugzilla-3ba91b28893ab0192f995067404c90f2143e425a.tar.xz
Bug 624696: We need a template hook to add a description to parameters added by extensions
r/a=mkanat
-rw-r--r--extensions/Example/Extension.pm7
-rw-r--r--extensions/Example/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl23
-rw-r--r--template/en/default/admin/params/editparams.html.tmpl1
3 files changed, 30 insertions, 1 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index 1ac121235..78f7c6d24 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -267,9 +267,14 @@ sub config_modify_panels {
my $auth_params = $panels->{'auth'}->{params};
my ($info_class) = grep($_->{name} eq 'user_info_class', @$auth_params);
my ($verify_class) = grep($_->{name} eq 'user_verify_class', @$auth_params);
-
+
push(@{ $info_class->{choices} }, 'CGI,Example');
push(@{ $verify_class->{choices} }, 'Example');
+
+ push(@$auth_params, { name => 'param_example',
+ type => 't',
+ default => 0,
+ checker => \&check_numeric });
}
sub email_in_before_parse {
diff --git a/extensions/Example/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl b/extensions/Example/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl
new file mode 100644
index 000000000..4ed719fe0
--- /dev/null
+++ b/extensions/Example/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl
@@ -0,0 +1,23 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Example Bugzilla Extension.
+ #
+ # The Initial Developer of the Original Code is Ali Ustek
+ # Portions created by the Initial Developer are Copyright (C) 2011 the
+ # Initial Developer. All Rights Reserved.
+ #
+ # Contributor(s):
+ # Ali Ustek <aliustek@gmail.com>
+ #%]
+
+[% IF panel.name == "auth" %]
+ [% panel.param_descs.param_example ='Example new parameter' %]
+[% END -%]
diff --git a/template/en/default/admin/params/editparams.html.tmpl b/template/en/default/admin/params/editparams.html.tmpl
index 77d843da2..730d7ae34 100644
--- a/template/en/default/admin/params/editparams.html.tmpl
+++ b/template/en/default/admin/params/editparams.html.tmpl
@@ -73,6 +73,7 @@
[% FOREACH panel = panels %]
<tr>
[% IF panel.current %]
+ [% Hook.process("current_panel") %]
<td class="selected_section">
<span title="[% panel.desc FILTER html %]">[% panel.title FILTER html %]</span>
</td>