A little more refactoring....

This commit is contained in:
finlayt 2002-09-11 22:11:17 +00:00
parent cc532cac39
commit 0ebbdaaed5
1 changed files with 11 additions and 24 deletions

View File

@ -1,35 +1,22 @@
#!/usr/bin/perl
use HTML::Template;
use HTML::Template; # new Template
use strict;
require Exporter;
use C4::Database;
use C4::Output; # contains picktemplate
use CGI;
use C4::Auth;
use C4::Database; # configfile
use C4::Output; # themelanguage
use CGI; # new CGI
use C4::Auth; # checkauth
my $query = new CGI;
#my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
my %configfile;
open (KC, "/etc/koha.conf");
while (<KC>) {
chomp;
(next) if (/^\s*#/);
if (/(.*)\s*=\s*(.*)/) {
my $variable=$1;
my $value=$2;
# Clean up white space at beginning and end
$variable=~s/^\s*//g;
$variable=~s/\s*$//g;
$value=~s/^\s*//g;
$value=~s/\s*$//g;
$configfile{$variable}=$value;
}
}
my $configfile = configfile();
my $htdocs=$configfile{'opachtdocs'};
my $templatebase="opac-main.tmpl";
my ($theme, $lang)=themelanguage($htdocs, $templatebase);
my $htdocs = $configfile->{'opachtdocs'};
my $templatebase = "opac-main.tmpl";
my ($theme, $lang) = themelanguage($htdocs, $templatebase);
my $template = HTML::Template->new(filename => "$htdocs/$theme/$lang/$templatebase", die_on_bad_params => 0, path => ["$htdocs/includes"]);