From 3698e204a13360768005ca0ae870f1aa82d6602a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 19 Aug 2013 11:16:51 -0400 Subject: [PATCH] Bug 10763 - [SIGNED-OFF] Update POD of C4::Creators::Lib::html_table() to use TT syntax This patch updates the example template syntax in the POD for C4::Creators::Lib::html_table() to use Template Toolkit syntax. To test, view the POD for C4::Creators::Lib::html_table() and confirm that it looks correct. Signed-off-by: Magnus Enger Checked the POD with "perldoc C4/Creators/Lib.pm" before and after applying the patch. The example now uses TT syntax, and looks sensible. Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton (cherry picked from commit 54c6dccca70a142c14fff049cb3212694af86610) Signed-off-by: Tomas Cohen Arazi (cherry picked from commit a55080c88593b5e0e0d3d8192ee9c7f09e78d258) Signed-off-by: Bernardo Gonzalez Kriegel (cherry picked from commit a55080c88593b5e0e0d3d8192ee9c7f09e78d258) Signed-off-by: Chris Hall (cherry picked from commit 64c3c216498a0144319639dd381c28c9d717f1bb) --- C4/Creators/Lib.pm | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm index eb8cde7ad3..2ab18f431d 100644 --- a/C4/Creators/Lib.pm +++ b/C4/Creators/Lib.pm @@ -486,37 +486,35 @@ sub get_table_names { =head2 C4::Creators::Lib::html_table() This function returns an arrayref of an array of hashes contianing the supplied data formatted suitably to -be passed off as a T::P template parameter and used to build an html table. +be passed off as a template parameter and used to build an html table. my $table = html_table(header_fields, array_of_row_data); $template->param( - TABLE => $table, + table_loop => $table, ); html example: - - - - - - - - - - - - - - - - - - - - - - +
" /> 
+ [% FOREACH table_loo IN table_loop %] + [% IF ( table_loo.header_fields ) %] + + [% FOREACH header_field IN table_loo.header_fields %] + + [% END %] + + [% ELSE %] + + [% FOREACH text_field IN table_loo.text_fields %] + [% IF ( text_field.select_field ) %] + + [% ELSE %] + + [% END %] + [% END %] + + [% END %] + [% END %]
[% header_field.field_label %]
[% text_field.field_value %]
=cut -- 2.39.5