X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=12f6c1e046710e85342a7fbb610ff3323952cd8f;hb=64aa9aa36d8b8636b4984de7d15cd7bd1a889542;hp=d8ab30a323c0d525edc196531ba65c474485d8b7;hpb=062f38f2f5d0da64c6fd0702d4df2e805473a1f5;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index d8ab30a32..12f6c1e04 100644 --- a/httemplate/search/elements/search-html.html +++ b/httemplate/search/elements/search-html.html @@ -349,6 +349,7 @@ $rows => [] % } % my $i = 0; # for row striping # XXX CSS - nth-child +% my $id = 0; % foreach my $row ( @$rows ) { % % my $rowstyle = ''; @@ -377,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' ) { % @@ -443,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); @@ -490,11 +505,11 @@ $rows => [] % % $tooltip = &{$tooltip}($row) % if ref($tooltip) eq 'CODE'; -% $tooltip = qq! title="<% $tooltip |h %>"!; -%# qq! onmouseover="return overlib(!. -%# $m->interp->apply_escapes($tooltip, 'h', 'js_string'). -%# qq!, FGCLASS, 'tooltip', REF, 'a$id', !. -%# qq!REFC, 'LL', REFP, 'UL')"! if $tooltip; +% $tooltip = qq! id="a$id" !. +% qq! onmouseover="return overlib(!. +% $m->interp->apply_escapes($tooltip, 'h', 'js_string'). +% qq!, FGCLASS, 'tooltip', REF, 'a$id', !. +% qq!REFC, 'LL', REFP, 'UL')"! if $tooltip; % % if ( $link ) { % my( $url, $method ) = @{$link}; @@ -511,6 +526,7 @@ $rows => [] % elsif ( $tooltip ) { % $a = qq(); % } +% $id++; % } %