summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Attachment.pm
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-02-13 11:27:20 +0100
committerbbaetz%student.usyd.edu.au <>2002-02-13 11:27:20 +0100
commite1235d08fc52ff4cb914efecda9b15c2b7943f5a (patch)
tree2673752da715c22fabf9bacc440e48a943afeb82 /Bugzilla/Attachment.pm
parent5938698d13c326114857aaebb34a0f7081e1d486 (diff)
downloadbugzilla-e1235d08fc52ff4cb914efecda9b15c2b7943f5a.tar.gz
bugzilla-e1235d08fc52ff4cb914efecda9b15c2b7943f5a.tar.xz
Bug 100094 - use generic template handling code
r=mattyt, afranke
Diffstat (limited to 'Bugzilla/Attachment.pm')
-rw-r--r--Bugzilla/Attachment.pm35
1 files changed, 11 insertions, 24 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index 4b4b19ec3..1b6d74062 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -27,25 +27,15 @@
use diagnostics;
use strict;
+use vars qw(
+ $template
+ $vars
+);
+
package Attachment;
-# Use the template toolkit (http://www.template-toolkit.org/) to generate
-# the user interface (HTML pages and mail messages) using templates in the
-# "templates/" subdirectory.
-use Template;
-
-# This is the global template object that gets used one or more times by
-# the script when it needs to process a template and return the results.
-# Configuration parameters can be specified here that apply to all templates
-# processed in this file.
-my $template = Template->new(
- {
- # Colon-separated list of directories containing templates.
- INCLUDE_PATH => 'template/custom:template/default' ,
- # Allow templates to be specified with relative paths.
- RELATIVE => 1
- }
-);
+my $template = $::template;
+my $vars = $::vars;
# This module requires that its caller have said "require CGI.pl" to import
# relevant functions from that script and its companion globals.pl.
@@ -99,16 +89,13 @@ sub list
push @attachments, \%a;
}
- my $vars =
- {
- 'bugid' => $bugid ,
- 'attachments' => \@attachments ,
- 'Param' => \&::Param , # for retrieving global parameters
- 'PerformSubsts' => \&::PerformSubsts # for processing global parameters
- };
+ $vars->{'bugid'} = $bugid;
+ $vars->{'attachments'} = \@attachments;
$template->process("attachment/list.atml", $vars)
|| &::DisplayError("Template process failed: " . $template->error())
&& exit;
}
+
+1;