]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 296214: Add a hook into user-error.html.tmpl to allow user-extendable error messa...
authorlpsolit%gmail.com <>
Sat, 11 Jun 2005 02:11:46 +0000 (02:11 +0000)
committerlpsolit%gmail.com <>
Sat, 11 Jun 2005 02:11:46 +0000 (02:11 +0000)
template/en/default/global/user-error.html.tmpl

index 1aa55be58cccb27ffd43260c84bd79433e08f2b7..3d7599711af94ad502f2c4bac76fc72706632a13 100644 (file)
   #
   # Note that you must explicitly filter every single template variable
   # in this file; if you do not wish to change it, use the "none" filter.
+  # 
+  # Extension- or custom-specific error handling  can be easily added 
+  # via hooks: just place your <extension>-errors.html.tmpl into 
+  # template/en/extension/hook/global/user-error.html.tmpl/errors/
+  # Note: be aware of uniqueness of error string parameter value, since 
+  # nobody can guarantee the hook files processing order in the future
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
     The file you are trying to attach is empty!
 
   [% ELSE %]
-    [% title = "Error string not found" %]
-    The user error string <code>[% error FILTER html %]</code> was not found.
-    Please send email to [% Param("maintainer") %] describing the steps taken
-    to obtain this message.
+
+    [%# Try to find hooked error messages %]
+    [% error_message = Hook.process("errors") %]
+
+    [% IF not error_message %]
+      [% title = "Error string not found" %]
+      The user error string <code>[% error FILTER html %]</code> was not found.
+      Please send email to [% Param("maintainer") %] describing the steps taken
+      to obtain this message.
+    [% ELSE %]
+      [% error_message FILTER none %]
+    [% END %]
   [% END %]
 [% END %]