.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "LedgerSMB::Template 3pm" .TH LedgerSMB::Template 3pm "2012-05-30" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" LedgerSMB::Template \- Template support module for LedgerSMB .SH "SYNOPSIS" .IX Header "SYNOPSIS" This module renders templates. .SH "METHODS" .IX Header "METHODS" .ie n .IP "new(user => \e%myconfig, template => $string, format => $string, [locale => $locale] [language => $string], [include_path => $path], [no_auto_output => $bool], [method => $string], [no_escape => $bool], [debug => $bool], [output_file => $string] );" 4 .el .IP "new(user => \e%myconfig, template => \f(CW$string\fR, format => \f(CW$string\fR, [locale => \f(CW$locale\fR] [language => \f(CW$string\fR], [include_path => \f(CW$path\fR], [no_auto_output => \f(CW$bool\fR], [method => \f(CW$string\fR], [no_escape => \f(CW$bool\fR], [debug => \f(CW$bool\fR], [output_file => \f(CW$string\fR] );" 4 .IX Item "new(user => %myconfig, template => $string, format => $string, [locale => $locale] [language => $string], [include_path => $path], [no_auto_output => $bool], [method => $string], [no_escape => $bool], [debug => $bool], [output_file => $string] );" This command instantiates a new template: .RS 4 .IP "template" 4 .IX Item "template" The template to be processed. This can either be a reference to the template in string form or the name of the file that is the template to be processed. .IP "format" 4 .IX Item "format" The format to be used. Currently \s-1HTML\s0, \s-1PS\s0, \s-1PDF\s0, \s-1TXT\s0 and \s-1CSV\s0 are supported. .IP "format_options (optional)" 4 .IX Item "format_options (optional)" A hash of format-specific options. See the appropriate LSMB::T::foo for details. .IP "output_options (optional)" 4 .IX Item "output_options (optional)" A hash of output-specific options. See the appropriate output method for details. .IP "locale (optional)" 4 .IX Item "locale (optional)" The locale object to use for regular gettext lookups. Having this option adds the text function to the usable list for the templates. Has no effect on the gettext function. .IP "language (optional)" 4 .IX Item "language (optional)" The language for template selection. .IP "include_path (optional)" 4 .IX Item "include_path (optional)" Overrides the template directory. Used with user interface templates. .IP "no_auto_output (optional)" 4 .IX Item "no_auto_output (optional)" Disables the automatic output of rendered templates. .IP "no_escape (optional)" 4 .IX Item "no_escape (optional)" Disables escaping on the template variables. .IP "debug (optional)" 4 .IX Item "debug (optional)" Enables template debugging. .Sp With the TT-based renderers, \s-1HTML\s0, \s-1PS\s0, \s-1PDF\s0, \s-1TXT\s0, and \s-1CSV\s0, the portion of the template to get debugging messages is to be surrounded by statements. Example: .Sp .Vb 8 \& \& \& \& \& \& \& \& .Ve .IP "method/media (optional)" 4 .IX Item "method/media (optional)" The output method to use, defaults to \s-1HTTP\s0. Media is a synonym for method .IP "output_file (optional)" 4 .IX Item "output_file (optional)" The base name of the file for output. .RE .RS 4 .RE .IP "\fIavailable_formats()\fR" 4 .IX Item "available_formats()" Returns a list of format names, any of the following (in order) as applicable: .RS 4 .IP "\s-1HTML\s0 (always available)" 4 .IX Item "HTML (always available)" .PD 0 .IP "\s-1TXT\s0 (includes \s-1CSV\s0, always available))" 4 .IX Item "TXT (includes CSV, always available))" .IP "\s-1PDF\s0" 4 .IX Item "PDF" .IP "\s-1PS\s0" 4 .IX Item "PS" .IP "\s-1XLS\s0" 4 .IX Item "XLS" .IP "\s-1ODS\s0" 4 .IX Item "ODS" .RE .RS 4 .RE .ie n .IP "new_UI(user => \e%myconfig, locale => $locale, template => $file, ...)" 4 .el .IP "new_UI(user => \e%myconfig, locale => \f(CW$locale\fR, template => \f(CW$file\fR, ...)" 4 .IX Item "new_UI(user => %myconfig, locale => $locale, template => $file, ...)" .PD Wrapper around the constructor that sets the path to '\s-1UI\s0', format to '\s-1HTML\s0', and leaves auto-output enabled. .IP "render($hashref)" 4 .IX Item "render($hashref)" This command renders the template. If no_auto_output was not specified during instantiation, this also writes the result to standard output and exits. Otherwise it returns the name of the output file if a file was created. When no output file is created, the output is held in \f(CW$self\fR\->{output}. .Sp Currently email and server-side printing are not supported. .IP "output" 4 .IX Item "output" This function outputs the rendered file in an appropriate manner. .ie n .IP "my $bool = \fI_valid_language()\fR" 4 .el .IP "my \f(CW$bool\fR = \fI_valid_language()\fR" 4 .IX Item "my $bool = _valid_language()" This command checks for valid langages. Returns 1 if the language is valid, 0 if it is not. .IP "\fIcolumn_heading()\fR" 4 .IX Item "column_heading()" Apply locale settings to column headings and add sort urls if necessary. .IP "escape($string)" 4 .IX Item "escape($string)" Escapes a scalar string if the format supports such escaping and returns the sanitized version. .SH "Copyright 2007, The LedgerSMB Core Team" .IX Header "Copyright 2007, The LedgerSMB Core Team" This file is licensed under the \s-1GNU\s0 General Public License version 2, or at your option any later version. A copy of the license should have been included with your software.