X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=12f6c1e046710e85342a7fbb610ff3323952cd8f;hb=811a439e2a3600dc563e976f5d783e7881faff54;hp=1348995976ae83704d5b3363f2dd8748a637f8a2;hpb=83303105b038082cdb800a4f7322b4dd08b6fe89;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index 134899597..12f6c1e04 100644 --- a/httemplate/search/elements/search-html.html +++ b/httemplate/search/elements/search-html.html @@ -378,9 +378,16 @@ $rows => [] % my $sizes = $opt{'size'} ? [ @{$opt{'size'}} ] : []; % my $styles = $opt{'style'} ? [ @{$opt{'style'}} ] : []; % my $cstyles = $opt{'cell_style'} ? [ @{$opt{'cell_style'}} ] : []; +% my $formats = $opt{'format'} ? [ @{$opt{'format'}} ] : []; % % foreach my $field ( % +% # if the value of the field is an arrayref, then construct a table in +% # the cell. +% # if it's a (non-empty) scalar, and a format has been specified, then +% # format the scalar with that. +% # otherwise, just output the value. +% # XXX we should also do date formats like this % map { % if ( ref($_) eq 'ARRAY' ) { % @@ -444,10 +451,17 @@ $rows => [] % ''; % % } else { +% if ( length($_) > 0 and my $format = shift @$formats ) { +% $_ = sprintf($format, $_); +% } % $_; % } % } % +% # get the value of the field spec: +% # - if the spec is a coderef, evaluate the coderef +% # - if the spec is a string, call that string as a method +% # - if the spec is an integer, get the field in that position % map { % if ( ref($_) eq 'CODE' ) { % &{$_}($row);