[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Output.pm,1.18,1.18.2.1
From: |
Andrew Arensburger |
Subject: |
[Koha-cvs] CVS: koha/C4 Output.pm,1.18,1.18.2.1 |
Date: |
Thu, 03 Oct 2002 19:52:35 -0700 |
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv26063
Modified Files:
Tag: arensb-context
Output.pm
Log Message:
Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
C4Connect.
Removed old code for reading /etc/koha.conf.
Index: Output.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Output.pm,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C2 -r1.18 -r1.18.2.1
*** Output.pm 22 Sep 2002 04:04:22 -0000 1.18
--- Output.pm 4 Oct 2002 02:52:33 -0000 1.18.2.1
***************
*** 26,29 ****
--- 26,30 ----
require Exporter;
+ use C4::Context;
use C4::Database;
use C4::Search; #for getting the systempreferences
***************
*** 92,121 ****
# the functions below that use them.
! #
! # Change this value to reflect where you will store your includes
! #
! # FIXME - Since this is used in several places, it ought to be put
! # into a separate file. Better yet, put "use C4::Config;" inside the
! # &import method of any package that requires the config file.
! my %configfile;
! open (KC, "/etc/koha.conf");
! while (<KC>) {
! chomp;
! (next) if (/^\s*#/);
! if (/(.*)\s*=\s*(.*)/) {
! my $variable=$1;
! my $value=$2;
!
! $variable =~ s/^\s*//g;
! $variable =~ s/\s*$//g;
! $value =~ s/^\s*//g;
! $value =~ s/\s*$//g;
! $configfile{$variable}=$value;
! } # if
! } # while
! close(KC);
!
! my $path=$configfile{'includes'};
! ($path) || ($path="/usr/local/www/hdl/htdocs/includes");
# make all your functions, whether exported or not;
--- 93,98 ----
# the functions below that use them.
! my $path = C4::Context->config('includes') ||
! "/usr/local/www/hdl/htdocs/includes";
# make all your functions, whether exported or not;
***************
*** 140,144 ****
sub picktemplate {
my ($includes, $base) = @_;
! my $dbh=C4Connect;
my $templates;
# FIXME - Instead of generating the list of possible templates, and
--- 117,121 ----
sub picktemplate {
my ($includes, $base) = @_;
! my $dbh = C4::Context->dbh;
my $templates;
# FIXME - Instead of generating the list of possible templates, and
***************
*** 159,163 ****
my ($preftemplate) = $sth->fetchrow;
$sth->finish;
- $dbh->disconnect;
if ($templates->{$preftemplate}) {
return $preftemplate;
--- 136,139 ----
***************
*** 257,261 ****
#where to search for templates
my @tmpldirs = ("$path/templates", $path);
! unshift (@tmpldirs, $configfile{'templatedirectory'}) if
$configfile{'templatedirectory'};
unshift (@tmpldirs, $params{'path'}) if $params{'path'};
--- 233,237 ----
#where to search for templates
my @tmpldirs = ("$path/templates", $path);
! unshift (@tmpldirs, C4::Context->config('templatedirectory')) if
C4::Context->config('templatedirectory');
unshift (@tmpldirs, $params{'path'}) if $params{'path'};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Output.pm,1.18,1.18.2.1,
Andrew Arensburger <=