From 3ba91b28893ab0192f995067404c90f2143e425a Mon Sep 17 00:00:00 2001 From: rojanu Date: Sat, 22 Jan 2011 18:51:36 +0100 Subject: Bug 624696: We need a template hook to add a description to parameters added by extensions r/a=mkanat --- extensions/Example/Extension.pm | 7 ++++++- .../params/editparams-current_panel.html.tmpl | 23 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 extensions/Example/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl (limited to 'extensions/Example') 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 + #%] + +[% IF panel.name == "auth" %] + [% panel.param_descs.param_example ='Example new parameter' %] +[% END -%] -- cgit v1.2.3-24-g4f1b