New scripts for translation into Chinese and other languages where English
[koha.git] / C4 / Interface / CGI / Template.pm
1 package C4::Interface::CGI::Template;
2
3 # $Id$
4
5 # convenience package for HTML templating
6 # Note: This is just a utility module; it should not be instantiated.
7
8
9 # Copyright 2003 Katipo Communications
10 #
11 # This file is part of Koha.
12 #
13 # Koha is free software; you can redistribute it and/or modify it under the
14 # terms of the GNU General Public License as published by the Free Software
15 # Foundation; either version 2 of the License, or (at your option) any later
16 # version.
17 #
18 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
19 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
20 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License along with
23 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
24 # Suite 330, Boston, MA  02111-1307 USA
25
26 use strict;
27 require Exporter;
28
29 use vars qw($VERSION @ISA @EXPORT);
30
31 # set the version for version checking
32 $VERSION = 0.01;
33
34 =head1 NAME
35
36 C4::Members - Convenience functions for using HTML::Template
37
38 =head1 SYNOPSIS
39
40   use C4::Interface::HTML::Template;
41
42 =head1 DESCRIPTION
43
44 The functions in this module peek into a piece of HTML and return strings
45 related to the (guessed) charset.
46
47 =head1 FUNCTIONS
48
49 =over 2
50
51 =cut
52
53 @ISA = qw(Exporter);
54 @EXPORT = qw(
55                 &expand_sex_into_predicate
56              );
57
58 =item expand_sex_into_predicate
59
60   $data{&expand_sex_into_predicate($data{sex})} = 1;
61
62 Converts a single 'M' or 'F' into 'sex_M_p' or 'sex_F_p'
63 respectively.
64
65 In some languages, 'M' and 'F' are not appropriate. However,
66 with HTML::Template, there is no way to localize 'M' or 'F'
67 unless these are converted into variables that TMPL_IF can
68 understand. This function provides this conversion.
69
70 =cut
71
72 sub expand_sex_into_predicate ($) {
73    my($sex) = @_;
74    return "sex_${sex}_p";
75 } # expand_sex_into_predicate
76
77 #---------------------------------
78
79 END { }       # module clean-up code here (global destructor)
80
81 1;
82 __END__
83
84 =back
85
86 =head1 AUTHOR
87
88 Koha Developement team <info@koha.org>
89
90 =cut