[Koha-cvs] CVS: koha/html-template cmsdsearchresults.tmpl,NONE,1.1 searchheader.tmpl,NONE,1.1 search.pl,1.2,1.3 searchresults.tmpl,1.3,1.4

Steve Tonnesen tonnesen at users.sourceforge.net
Fri May 10 19:41:07 CEST 2002


Update of /cvsroot/koha/koha/html-template
In directory usw-pr-cvs1:/tmp/cvs-serv22326

Modified Files:
	search.pl searchresults.tmpl 
Added Files:
	cmsdsearchresults.tmpl searchheader.tmpl 
Log Message:
Added ability to switch between two templates.  One template shows 
biblionumber, the other template shows notes, in the third column.

My thinking is that for every template, the scripts can search for a local
version of the template before using the default template.


--- NEW FILE ---
<html>
<head><title>Search Results</title>
</head>
<body>
<TMPL_INCLUDE NAME="searchheader.tmpl">
<table border=1>
<tr><th>Title</th><th>Author</th><th>Notes</th></tr>
<TMPL_LOOP NAME=SEARCH_RESULTS>
  <tr>
  <td> <TMPL_VAR NAME=title> </td>
  <td> <TMPL_VAR NAME=author> </td>
  <td> <TMPL_VAR NAME=notes> </td>
  </tr>
</TMPL_LOOP>
</table>
<hr>
</body>
</html>

--- NEW FILE ---
<a href=search.pl?template=cmsdsearchresults.tmpl>Template #1</a> | <a href=search.pl?template=searchresults.tmpl>Template #2</a>
<hr>

Index: search.pl
===================================================================
RCS file: /cvsroot/koha/koha/html-template/search.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** search.pl	10 May 2002 17:21:36 -0000	1.2
--- search.pl	10 May 2002 17:41:05 -0000	1.3
***************
*** 4,7 ****
--- 4,13 ----
  require Exporter;
  use C4::Database;
+ use CGI;
+  
+ my $query=new CGI;
+ 
+ my $template=$query->param('template');
+ ($template) || ($template='searchresults.tmpl');
  
  
***************
*** 9,13 ****
  
  
! my $template = HTML::Template->new(filename => 'searchresults.tmpl', die_on_bad_params => 0);
  
  my @results;
--- 15,19 ----
  
  
! my $template = HTML::Template->new(filename => $template, die_on_bad_params => 0);
  
  my @results;

Index: searchresults.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/html-template/searchresults.tmpl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** searchresults.tmpl	10 May 2002 17:21:36 -0000	1.3
--- searchresults.tmpl	10 May 2002 17:41:05 -0000	1.4
***************
*** 1,6 ****
  <html>
! <head><title>Test Template</title>
  </head>
  <body>
  <table border=1>
  <tr><th>Title</th><th>Author</th><th>Biblionumber</th></tr>
--- 1,7 ----
  <html>
! <head><title>Search Results</title>
  </head>
  <body>
+ <TMPL_INCLUDE NAME="searchheader.tmpl">
  <table border=1>
  <tr><th>Title</th><th>Author</th><th>Biblionumber</th></tr>





More information about the Koha-cvs mailing list