Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / elements / tr-fixed.html
index 095e1bc..dad8da0 100644 (file)
@@ -1,6 +1,6 @@
 <% include('tr-td-label.html', @_ ) %>
 
-  <TD BGCOLOR="#dddddd" <% $style %>><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %></TD>
+  <TD <% $style %> <% $colspan %>><% $value %></TD>
 
 </TR>
 
 
 my %opt = @_;
 
-my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+my $style = $opt{'cell_style'}
+              ? ' STYLE="'. $opt{'cell_style'}. '" '
+              : ' STYLE="color:#666666" ';
+
+my $colspan = $opt{'colspan'} ? ' COLSPAN="'. $opt{'colspan'}. '" ' : '';
+
+my $value = $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'};
+$value = $opt{'prefix'} . $value if defined($opt{'prefix'});
+
+unless ( $opt{'noescape'} ) {
+  #compatibility with select-table and friends
+  if ( $opt{'multiple'} ) {
+    $value = [ split(/\s*,\s*/, $value) ] if !ref $value;
+    $value = join('<BR>', map {encode_entities($_)} @$value);
+  } else {
+    $value = encode_entities($value)
+  }
+}
 
 </%init>