[Rt-commit] r17174 - in rt/3.8/trunk: share/html/Elements/CollectionAsTable
sartak at bestpractical.com
sartak at bestpractical.com
Thu Dec 11 16:11:09 EST 2008
Author: sartak
Date: Thu Dec 11 16:11:09 2008
New Revision: 17174
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/share/html/Elements/CollectionAsTable/Header
rt/3.8/trunk/share/html/Elements/CollectionAsTable/ParseFormat
rt/3.8/trunk/share/html/Elements/CollectionAsTable/Row
Log:
r77033 at onn: sartak | 2008-12-11 16:10:41 -0500
Allow setting colspan in search formats.
Patch by Olly Stephens [rt3.fsck.com #12728]
Modified: rt/3.8/trunk/share/html/Elements/CollectionAsTable/Header
==============================================================================
--- rt/3.8/trunk/share/html/Elements/CollectionAsTable/Header (original)
+++ rt/3.8/trunk/share/html/Elements/CollectionAsTable/Header Thu Dec 11 16:11:09 2008
@@ -87,9 +87,12 @@
next;
}
- $item++;
+ my $span = $col->{'span'};
+ $item += ($span || 1);
- $m->out('<th class="collection-as-table">');
+ $m->out('<th class="collection-as-table"');
+ $m->out(' colspan="' . $span . '"') if $span;
+ $m->out('>');
$title =~ s/^__(.*)__$/$1/o;
my $tmp = $m->comp( '/Elements/ColumnMap',
Modified: rt/3.8/trunk/share/html/Elements/CollectionAsTable/ParseFormat
==============================================================================
--- rt/3.8/trunk/share/html/Elements/CollectionAsTable/ParseFormat (original)
+++ rt/3.8/trunk/share/html/Elements/CollectionAsTable/ParseFormat Thu Dec 11 16:11:09 2008
@@ -77,6 +77,9 @@
if ( $col =~ s!/ALIGN:([^\/]+)!!io ) {
$colref->{'align'} = $1;
}
+ if ( $col =~ s!/SPAN:([^\/]+)!!io ) {
+ $colref->{'span'} = $1;
+ }
if ( $col =~ /__(.*?)__/io ) {
my @subcols;
while ( $col =~ s/^(.*?)__(.*?)__//o ) {
Modified: rt/3.8/trunk/share/html/Elements/CollectionAsTable/Row
==============================================================================
--- rt/3.8/trunk/share/html/Elements/CollectionAsTable/Row (original)
+++ rt/3.8/trunk/share/html/Elements/CollectionAsTable/Row Thu Dec 11 16:11:09 2008
@@ -76,12 +76,14 @@
next;
}
- $item++;
my $class = $column->{class} ? encode_entities( $column->{class}, q{'"&<>} ) : 'collection-as-table';
$m->out(qq{<td class="$class" });
my $align = $column->{align};
my $style = $column->{style};
+ my $span = $column->{span};
+
+ $item += ($span || 1);
my @out;
foreach my $subcol ( @{ $column->{output} } ) {
@@ -129,8 +131,9 @@
}
s/\n/<br \/>/gs for @out;
}
- $m->out( 'align="' . $align . '"' ) if $align;
- $m->out( 'style="' . $style . '"' ) if $style;
+ $m->out( 'align="' . $align . '"' ) if $align;
+ $m->out( 'style="' . $style . '"' ) if $style;
+ $m->out( 'colspan="' . $span . '"' ) if $span;
$m->out('>');
$m->out(@out) if @out;
$m->out( '</td>' . "\n" );
More information about the Rt-commit
mailing list