From 6e9e3cf3abe7ef3d72e88aad63a43b32c0a70a70 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 28 Oct 2002 18:00:57 +0000 Subject: [PATCH] templating stuff : use of gettemplate method --- imemberentry.pl | 4 +--- jmemberentry.pl | 4 +--- member.pl | 9 +++++---- memberentry.pl | 6 ++---- moremember.pl | 4 +--- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/imemberentry.pl b/imemberentry.pl index 4910ce04a9..507c342546 100755 --- a/imemberentry.pl +++ b/imemberentry.pl @@ -29,9 +29,7 @@ use HTML::Template; my $input = new CGI; -my $theme = $input->param('theme'); # only used if allowthemeoverride is set -my %tmpldata = pathtotemplate ( template => 'imemberentry.tmpl', theme => $theme ); -my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0); +my $template = gettemplate("members/imemberentry.tmpl"); my $member=$input->param('bornum'); if ($member eq ''){ diff --git a/jmemberentry.pl b/jmemberentry.pl index 7c6418a94a..e7f949d6e7 100755 --- a/jmemberentry.pl +++ b/jmemberentry.pl @@ -29,9 +29,7 @@ use HTML::Template; my $input = new CGI; -my $theme = $input->param('theme'); # only used if allowthemeoverride is set -my %tmpldata = pathtotemplate ( template => 'jmemberentry.tmpl', theme => $theme ); -my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0); +my $template = gettemplate("members/jmemberentry.tmpl"); my $member=$input->param('bornum'); if ($member eq ''){ diff --git a/member.pl b/member.pl index 6a84456e26..b66c165a45 100755 --- a/member.pl +++ b/member.pl @@ -33,11 +33,12 @@ my $input = new CGI; my $theme = $input->param('theme') || "default"; # only used if allowthemeoverride is set -my %tmpldata = pathtotemplate ( template => 'member.tmpl', theme => $theme, language => 'fi' ); +#my %tmpldata = pathtotemplate ( template => 'member.tmpl', theme => $theme, language => 'fi' ); # FIXME - Error-checking -my $template = HTML::Template->new( filename => $tmpldata{'path'}, - die_on_bad_params => 0, - loop_context_vars => 1 ); +#my $template = HTML::Template->new( filename => $tmpldata{'path'}, +# die_on_bad_params => 0, +# loop_context_vars => 1 ); +my $template = gettemplate("members/member.tmpl"); my $member=$input->param('member'); $member=~ s/\,//g; diff --git a/memberentry.pl b/memberentry.pl index 4a6d469f5d..ad2c3bcff8 100755 --- a/memberentry.pl +++ b/memberentry.pl @@ -33,9 +33,7 @@ use HTML::Template; my $input = new CGI; -my $theme = $input->param('theme'); # only used if allowthemeoverride is set -my %tmpldata = pathtotemplate ( template => 'memberentry.tmpl', theme => $theme ); -my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0); +my $template = gettemplate("members/memberentry.tmpl"); my $member=$input->param('bornum'); if ($member eq ''){ @@ -130,7 +128,7 @@ if ($delete){ my $ethnicitycategoriescount=$#{$categories}; my $ethcatpopup; if ($ethnicitycategoriescount>=0) { - $ethcatpopup = popup_menu(-name=>'ethnicity', + $ethcatpopup = CGI::popup_menu(-name=>'ethnicity', -values=>$categories, -default=>$data->{'ethnicity'}, -labels=>$labels); diff --git a/moremember.pl b/moremember.pl index a4cd0347ce..43b4c98afc 100755 --- a/moremember.pl +++ b/moremember.pl @@ -46,9 +46,7 @@ my $dbh = C4::Context->dbh; my $input = new CGI; -my $theme = $input->param('theme'); # only used if allowthemeoverride is set -my %tmpldata = pathtotemplate ( template => 'moremember.tmpl', theme => $theme ); -my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0); +my $template = gettemplate("members/moremember.tmpl"); my $bornum=$input->param('bornum');