freeside/httemplate/search/elements search.html,1.6,1.7
ivan
ivan at pouncequick.420.am
Wed Aug 18 17:22:33 PDT 2004
Update of /home/cvs/cvsroot/freeside/httemplate/search/elements
In directory pouncequick:/tmp/cvs-serv15943/elements
Modified Files:
search.html
Log Message:
add customer # to payment reports, add table cell alignment option to general search component
Index: search.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/elements/search.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- search.html 28 May 2004 10:38:00 -0000 1.6
+++ search.html 19 Aug 2004 00:22:29 -0000 1.7
@@ -2,6 +2,16 @@
my(%opt) = @_;
+ my %align = (
+ 'l' => 'left',
+ 'r' => 'right',
+ 'c' => 'center',
+ ' ' => '',
+ '.' => '',
+ );
+ $opt{align} = [ map $align{$_}, split(//, $opt{align}) ],
+ unless !$opt{align} || ref($opt{align});
+
if ( ref($opt{'query'}) ) {
}
@@ -85,11 +95,14 @@
</TR>
<% foreach my $row ( @$rows ) { %>
<TR>
- <% if ( $opt{'fields'} ) { %>
- <% my $links = $opt{'links'} ? [ @{$opt{'links'}} ] : ''; %>
- <% foreach my $field ( @{$opt{'fields'}} ) { %>
- <% my $a = ''; %>
- <% if ( $links ) {
+ <% if ( $opt{'fields'} ) {
+ my $links = $opt{'links'} ? [ @{$opt{'links'}} ] : '';
+ my $aligns = $opt{'align'} ? [ @{$opt{'align'}} ] : '';
+ foreach my $field ( @{$opt{'fields'}} ) {
+ my $align = $aligns ? shift @$aligns : '';
+ $align = " ALIGN=$align" if $align;
+ my $a = '';
+ if ( $links ) {
my $link = shift @$links;
$link = &{$link}($row) if ref($link) eq 'CODE';
if ( $link ) {
@@ -104,9 +117,9 @@
}
%>
<% if ( ref($field) eq 'CODE' ) { %>
- <TD><%= $a %><%= &{$field}($row) %><%= $a ? '</A>' : '' %></TD>
+ <TD<%= $align %>><%= $a %><%= &{$field}($row) %><%= $a ? '</A>' : '' %></TD>
<% } else { %>
- <TD><%= $a %><%= $row->$field() %><%= $a ? '</A>' : '' %></TD>
+ <TD<%= $align %>><%= $a %><%= $row->$field() %><%= $a ? '</A>' : '' %></TD>
<% } %>
<% } %>
<% } else { %>
More information about the freeside-commits
mailing list