Bugzilla – Attachment 20475 Details for
Bug 10763
Update POD of C4::Creators::Lib::html_table() to use TT syntax
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10763 - Update POD of C4::Creators::Lib::html_table() to use TT syntax
Bug-10763---Update-POD-of-C4CreatorsLibhtmltable-t.patch (text/plain), 3.08 KB, created by
Owen Leonard
on 2013-08-19 15:18:51 UTC
(
hide
)
Description:
Bug 10763 - Update POD of C4::Creators::Lib::html_table() to use TT syntax
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-08-19 15:18:51 UTC
Size:
3.08 KB
patch
obsolete
>From 055935dc4f134368610649438727bd2a3fc1cf96 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 19 Aug 2013 11:16:51 -0400 >Subject: [PATCH] Bug 10763 - Update POD of C4::Creators::Lib::html_table() to > use TT syntax >Content-Type: text/plain; charset="utf-8" > >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. >--- > 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 d052427..6fa9bf4 100644 >--- a/C4/Creators/Lib.pm >+++ b/C4/Creators/Lib.pm >@@ -479,37 +479,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: > >- <table> >- <!-- TMPL_LOOP NAME="TABLE" --> >- <!-- TMPL_IF NAME="header_fields" --> >- <tr> >- <!-- TMPL_LOOP NAME="header_fields" --> >- <th><!-- TMPL_VAR NAME="field_label" --></th> >- <!-- /TMPL_LOOP --> >- </tr> >- <!-- TMPL_ELSE --> >- <tr> >- <!-- TMPL_LOOP NAME="text_fields" --> >- <!-- TMPL_IF NAME="select_field" --> >- <td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->" /></td> >- <!-- TMPL_ELSIF NAME="field_value" --> >- <td><!-- TMPL_VAR NAME="field_value" --></td> >- <!-- TMPL_ELSE --> >- <td> </td> >- <!-- /TMPL_IF --> >- <!-- /TMPL_LOOP --> >- </tr> >- <!-- /TMPL_IF --> >- <!-- /TMPL_LOOP --> >+ <table> >+ [% FOREACH table_loo IN table_loop %] >+ [% IF ( table_loo.header_fields ) %] >+ <tr> >+ [% FOREACH header_field IN table_loo.header_fields %] >+ <th>[% header_field.field_label %]</th> >+ [% END %] >+ </tr> >+ [% ELSE %] >+ <tr> >+ [% FOREACH text_field IN table_loo.text_fields %] >+ [% IF ( text_field.select_field ) %] >+ <td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td> >+ [% ELSE %] >+ <td>[% text_field.field_value %]</td> >+ [% END %] >+ [% END %] >+ </tr> >+ [% END %] >+ [% END %] > </table> > > =cut >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10763
:
20475
|
20493
|
20499