Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ledgersmb::template::elements(3pm) [debian man page]

LedgerSMB::Template::Elements(3pm)			User Contributed Perl Documentation			LedgerSMB::Template::Elements(3pm)

NAME
LedgerSMB::Template::Elements - Template Utility Functions SYNOPSIS
Provides utility functions for generating elements for the user interface templates METHODS
LedgerSMB::Template::Elements->new() Returns a blessed hashref from this namespace. $object->generate_hidden_elements([...]); Builds data structure for hidden form fields. Values from the $form object are run through $form->quote. Sample data structure added to $form->hidden_elements(): $self->{form_elements}{hidden_elements} = [{ type => 'hidden', name => 'foo', value => 'bar'... } ...] A reference to this structure is returned as well. $form->generate_radio_elements($radios); Roll out a single radios hash to an array of radio elements, using the values array as index. Sample data structure added to $form->generate_radio_elements($radios): my $radios = { name => 'radio_name', class => 'radio', attributes => { foo => 'bar' }, values => [ '1', '2', '3'], labels => [ 'Label one', '', 'Label three'], default_value => '2', }; $form->generate_checkbox_elements($checkboxes); Roll out a single checkboxes hash to an array of checkbox elements, using the names array as index. Note that if no 'values' array is passed, value for all checkboxes default to 1. Sample data structure added to $form->generate_checkbox_elements($checkboxes): my $checkboxes = { names => [ 'checkbox_name1', 'checkbox_name2', 'checkbox_name3', ], class => 'checkbox', attributes => { foo => 'bar' }, values => [ '4', '', '3'], labels => [ 'Label one', '', 'Label three'], default_values => [ 'checkbox_name1'], }; perl v5.14.2 2012-03-25 LedgerSMB::Template::Elements(3pm)

Check Out this Related Man Page

LedgerSMB::Template(3pm)				User Contributed Perl Documentation				  LedgerSMB::Template(3pm)

NAME
LedgerSMB::Template - Template support module for LedgerSMB SYNOPSIS
This module renders templates. METHODS
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: 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. format The format to be used. Currently HTML, PS, PDF, TXT and CSV are supported. format_options (optional) A hash of format-specific options. See the appropriate LSMB::T::foo for details. output_options (optional) A hash of output-specific options. See the appropriate output method for details. 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. language (optional) The language for template selection. include_path (optional) Overrides the template directory. Used with user interface templates. no_auto_output (optional) Disables the automatic output of rendered templates. no_escape (optional) Disables escaping on the template variables. debug (optional) Enables template debugging. With the TT-based renderers, HTML, PS, PDF, TXT, and CSV, the portion of the template to get debugging messages is to be surrounded by <?lsmb DEBUG format 'foo' ?> statements. Example: <tr><td colspan="<?lsmb columns.size ?>"></td></tr> <tr class="listheading"> <?lsmb FOREACH column IN columns ?> <?lsmb DEBUG format '$file line $line : [% $text %]' ?> <th class="listtop"><?lsmb heading.$column ?></th> <?lsmb DEBUG format '' ?> <?lsmb END ?> </tr> method/media (optional) The output method to use, defaults to HTTP. Media is a synonym for method output_file (optional) The base name of the file for output. available_formats() Returns a list of format names, any of the following (in order) as applicable: HTML (always available) TXT (includes CSV, always available)) PDF PS XLS ODS new_UI(user => \%myconfig, locale => $locale, template => $file, ...) Wrapper around the constructor that sets the path to 'UI', format to 'HTML', and leaves auto-output enabled. 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 $self->{output}. Currently email and server-side printing are not supported. output This function outputs the rendered file in an appropriate manner. my $bool = _valid_language() This command checks for valid langages. Returns 1 if the language is valid, 0 if it is not. column_heading() Apply locale settings to column headings and add sort urls if necessary. escape($string) Escapes a scalar string if the format supports such escaping and returns the sanitized version. Copyright 2007, The LedgerSMB Core Team This file is licensed under the GNU General Public License version 2, or at your option any later version. A copy of the license should have been included with your software. perl v5.14.2 2012-05-30 LedgerSMB::Template(3pm)
Man Page