]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 624696: We need a template hook to add a description to parameters added by exten...
authorrojanu <aliustek@gmail.com>
Sat, 22 Jan 2011 17:51:36 +0000 (18:51 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 22 Jan 2011 17:51:36 +0000 (18:51 +0100)
r/a=mkanat

extensions/Example/Extension.pm
extensions/Example/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl [new file with mode: 0644]
template/en/default/admin/params/editparams.html.tmpl

index 1ac1212358fe6698610a4e04d7f1cc8047dfb75e..78f7c6d242ed10652cf952a19ccf3478ad3f42ef 100644 (file)
@@ -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 (file)
index 0000000..4ed719f
--- /dev/null
@@ -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 -%]
index 77d843da29c33664f792807adb30cba26fe5d658..730d7ae343e4939ca4ce372d13e49eb9cae8c54c 100644 (file)
@@ -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>