use CGI;
use CGI::Ajax;
use Cwd;
+use IO::File;
use SL::Auth;
use SL::Auth::DB;
use SL::Auth::LDAP;
map { $additional_params->{$_} ||= $self->{$_} } keys %{ $self };
+ my $in = IO::File->new($file, 'r');
+
+ if (!$in) {
+ print STDERR "Error opening template file: $!";
+ $main::lxdebug->leave_sub();
+ return '';
+ }
+
+ my $input = join('', <$in>);
+ $in->close();
+
+ if ($main::locale) {
+ $input = $main::locale->{iconv}->convert($input);
+ }
+
my $output;
- if (!$template->process($file, $additional_params, \$output)) {
+ if (!$template->process(\$input, $additional_params, \$output)) {
print STDERR $template->error();
}
- $output = $main::locale->{iconv}->convert($output) if ($main::locale);
-
$main::lxdebug->leave_sub();
return $output;