[Koha-cvs] CVS: koha/C4 Output.pm,1.7,1.8

Chris Cormack rangi at users.sourceforge.net
Wed May 15 01:13:26 CEST 2002


Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv5971/C4

Modified Files:
	Output.pm 
Log Message:

Shifted picktemplate out into C4::Output.pm


Index: Output.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Output.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Output.pm	9 May 2002 01:07:36 -0000	1.7
--- Output.pm	14 May 2002 23:13:23 -0000	1.8
***************
*** 6,9 ****
--- 6,11 ----
  
  use strict;
+ use warnings;
+ use C4::Database;
  require Exporter;
  
***************
*** 16,20 ****
  @EXPORT = qw(&startpage &endpage &mktablehdr &mktableft &mktablerow &mklink
  &startmenu &endmenu &mkheadr &center &endcenter &mkform &mkform2 &bold
! &gotopage &mkformnotable &mkform3);
  %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
  
--- 18,22 ----
  @EXPORT = qw(&startpage &endpage &mktablehdr &mktableft &mktablerow &mklink
  &startmenu &endmenu &mkheadr &center &endcenter &mkform &mkform2 &bold
! &gotopage &mkformnotable &mkform3 picktemplate);
  %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
  
***************
*** 71,75 ****
     
  # make all your functions, whether exported or not;
!  
  sub startpage{
    return("<html>\n");
--- 73,105 ----
     
  # make all your functions, whether exported or not;
! 
! sub picktemplate {
!   my ($includes, $base) = @_;
!   my $dbh=C4Connect;
!   my $templates;
!   opendir (D, "$includes/templates");
!   my @dirlist=readdir D;
!   foreach (@dirlist) {
!     (next) if (/^\./);
!     #(next) unless (/\.tmpl$/);
!     (next) unless (-e "$includes/templates/$_/$base");
!     $templates->{$_}=1;
!   }							    
!   my $sth=$dbh->prepare("select value from systempreferences where
!   variable='template'");
!   $sth->execute;
!   my ($preftemplate) = $sth->fetchrow;
!   $sth->finish;
!   $dbh->disconnect;
!   if ($templates->{$preftemplate}) {
!     return $preftemplate;
!   } else {
!     return 'default';
!   }
!   
! }
! 				    
! 
! 
  sub startpage{
    return("<html>\n");
***************
*** 389,392 ****
--- 419,425 ----
    return($string);
  }
+ 
+ 
+ 
  
  END { }       # module clean-up code here (global destructor)





More information about the Koha-cvs mailing list