[Koha-cvs] CVS: koha/C4 Output.pm,1.6.2.17,1.6.2.18

Finlay Thompson finlayt at users.sourceforge.net
Thu Sep 12 06:22:37 CEST 2002


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

Modified Files:
      Tag: rel-1-2
	Output.pm 
Log Message:

added a gettemplate routine that does all the template intialisation and theme/lang stuff...


Index: Output.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Output.pm,v
retrieving revision 1.6.2.17
retrieving revision 1.6.2.18
diff -C2 -r1.6.2.17 -r1.6.2.18
*** Output.pm	11 Sep 2002 03:55:30 -0000	1.6.2.17
--- Output.pm	12 Sep 2002 04:22:35 -0000	1.6.2.18
***************
*** 28,31 ****
--- 28,32 ----
  require Exporter;
  
+ use HTML::Template;
  use C4::Database;
  use C4::Koha;
***************
*** 44,48 ****
  	     &gotopage &mkformnotable &mkform3
  	     &getkeytableselectoptions
! 	     &picktemplate &themelanguage
  );
  %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
--- 45,49 ----
  	     &gotopage &mkformnotable &mkform3
  	     &getkeytableselectoptions
! 	     &picktemplate &themelanguage &gettemplate
  );
  %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
***************
*** 79,82 ****
--- 80,103 ----
  
  # make all your functions, whether exported or not;
+ 
+ sub gettemplate {
+     my ($tmplbase, $opac) = @_;
+ 
+     my $htdocs;
+     if ($opac) {
+ 	$htdocs = $configfile->{'opachtdocs'};
+     } else {
+ 	$htdocs = $configfile->{'intrahtdocs'};
+     }
+ 
+     my ($theme, $lang) = themelanguage($htdocs, $tmplbase);
+ 
+     my $template = HTML::Template->new(filename          => "$htdocs/$theme/$lang/$tmplbase", 
+ 				   die_on_bad_params => 0, 
+ 				   path              => ["$htdocs/$theme/$lang/includes"]);
+ 
+     $template->param(themelang => "/$theme/$lang");
+     return $template;
+ }
  
  sub picktemplate {





More information about the Koha-cvs mailing list