koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-devel] Re: [Koha] Barcode scanner - keyboard wedge or not


From: paul POULAIN
Subject: [Koha-devel] Re: [Koha] Barcode scanner - keyboard wedge or not
Date: Mon May 26 03:30:01 2003
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Waylon Robertson wrote:
16/05/03 01:54:03, paul POULAIN <address@hidden> wrote:
Well.. incidently.. I know nothing about the template system.... and I know only english. Just want it in pre-template perl?
  
Fairly simple :
the templates are stored in a specific file & path, and looks like :
<HTML>
<TMPL_VAR NAME=startmenuissue>
<p>
Each box needs to be filled in with fine,time to start charging,charging cycle<br>
eg 1,7,7 = $1 fine, after 7 days, every 7 days.<p>

<table>
  <tr bgcolor="white">
    <TMPL_LOOP NAME=firstrowloop>
      <td><TMPL_VAR NAME=description></td>
    </TMPL_LOOP>
  </tr>
  <form action="" method=post>
  <TMPL_LOOP NAME=tablebodyloop>
    <tr bgcolor="whitw">
      <td><TMPL_VAR NAME=description></td>
      <TMPL_LOOP NAME=rowloop>
        <td><input type=text name="<TMPL_VAR NAME=name>" value="<TMPL_VAR NAME=value>" size=6></td>
      </TMPL_LOOP>
    </tr>
  </TMPL_LOOP>
</table>

<input type=submit>
</form>

<TMPL_VAR NAME=endmenuissue>

</body>
</HTML>


It's a mix of true HTML and H::T variables. The H::T are replaced during execution by "true" value. The templates are managed by specific koha-subs, that looks which one to use and check for auth :
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Interface::CGI::Output;
use C4::Database;
use HTML::Template;

my $query = new CGI;
my ($template, $loggedinuser, $cookie)
    = get_template_and_user({template_name => "parameters/admin-home.tmpl",
                 query => $query,
                 type => "intranet",
                 authnotrequired => 0,
                 flagsrequired => {parameters => 1},
                 debug => 1,
                 });

output_html_with_http_headers $query, $cookie, $template->output;

Look at : http://html-template.sourceforge.net/html_template.html#tutorial
for a tutorial and some explanations.

HTH
-- 
Paul POULAIN
Consultant indépendant en logiciels libres
responsable francophone de koha (SIGB libre http://www.koha-fr.org)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]