From d6b080ddd47d5c67ca8d4f918b3de91d9e697e5a Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 22 Mar 2011 16:18:23 +1300 Subject: [PATCH] Bug 5917 - Switching the installer to use Template Toolkit Signed-off-by: Chris Cormack --- C4/Output.pm | 9 --------- installer/InstallAuth.pm | 25 +++++++++++-------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index abd8fc3639..4ec958bef3 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -95,15 +95,6 @@ sub gettemplate { my $path = C4::Context->preference('intranet_includes') || 'includes'; my $opacstylesheet = C4::Context->preference('opacstylesheet'); my ( $htdocs, $theme, $lang, $filename ) = _get_template_file( $tmplbase, $interface, $query ); - -# my $template = HTML::Template::Pro->new( -# filename => $filename, -# die_on_bad_params => 1, -# global_vars => 1, -# case_sensitive => 1, -# loop_context_vars => 1, # enable: __first__, __last__, __inner__, __odd__, __counter__ -# path => ["$htdocs/$theme/$lang/$path"] -# ); $filename =~ s/\.tmpl$/.tt/; my $template = C4::Templates->new( $interface, $filename); my $themelang=( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ) diff --git a/installer/InstallAuth.pm b/installer/InstallAuth.pm index 3a55b21599..81c38fb199 100644 --- a/installer/InstallAuth.pm +++ b/installer/InstallAuth.pm @@ -27,6 +27,7 @@ use Digest::MD5 qw(md5_base64); require Exporter; use C4::Context; use C4::Output; +use C4::Templates; use C4::Koha; use CGI::Session; @@ -113,13 +114,12 @@ sub get_template_and_user { my $path = C4::Context->config('intrahtdocs') . "/prog/" . ( $language ? $language : "en" ); - my $template = HTML::Template::Pro->new( - filename => "$path/modules/" . $in->{template_name}, - die_on_bad_params => 1, - global_vars => 1, - case_sensitive => 1, - path => ["$path/includes"] - ); + + my $filename = "$path/modules/" . $in->{template_name}; + $filename =~ s/\.tmpl$/.tt/; + my $interface = 'intranet'; + my $template = C4::Templates->new( $interface, $filename); + my ( $user, $cookie, $sessionID, $flags ) = checkauth( $in->{'query'}, @@ -355,13 +355,10 @@ sub checkauth { my $path = C4::Context->config('intrahtdocs') . "/prog/" . ( $query->param('language') ? $query->param('language') : "en" ); - my $template = HTML::Template::Pro->new( - filename => "$path/modules/$template_name", - die_on_bad_params => 1, - global_vars => 1, - case_sensitive => 1, - path => ["$path/includes"] - ); + my $filename = "$path/modules/$template_name"; + $filename =~ s/\.tmpl$/.tt/; + my $interface = 'intranet'; + my $template = C4::Templates->new( $interface, $filename); $template->param( INPUTS => \@inputs, -- 2.39.5