X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FLayout%2FSplit.pm;fp=SL%2FLayout%2FSplit.pm;h=a262b5bebe2334173f1b8d2ec0da3e5af1dfb5f8;hp=0000000000000000000000000000000000000000;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/SL/Layout/Split.pm b/SL/Layout/Split.pm new file mode 100644 index 000000000..a262b5beb --- /dev/null +++ b/SL/Layout/Split.pm @@ -0,0 +1,65 @@ +package SL::Layout::Split; + +use strict; +use parent qw(SL::Layout::Base); + +use SL::Presenter::Tag qw(html_tag); + +use Rose::Object::MakeMethods::Generic ( + 'scalar' => [ qw(left right) ], +); + +sub sub_layouts { + @{ $_[0]->left || [] }, + @{ $_[0]->right || [] }, +} + +sub pre_content { + my $left = join '', map { $_->pre_content } @{ $_[0]->left || [] }; + my $right = join '', map { $_->pre_content } @{ $_[0]->right || [] }; + + html_tag('div', $left, class => 'layout-split-left') + .'
' . $right; +} + +sub post_content { + my $left = join '', map { $_->post_content } @{ $_[0]->left || [] }; + my $right = join '', map { $_->post_content } @{ $_[0]->right || [] }; + + $right . '
' + . html_tag('div', $left, class => 't-layout-left'); +} + +1; + +__END__ + +=encoding utf-8 + +=head1 NAME + +SL::Layout::Split + +=head1 SYNOPSIS + + use SL::Layout::Split; + + SL::Layout::Split->new( + left => [ LIST OF SUBLAYOUTS ], + right => [ LIST OF SUBLAYOUTS ], + ); + +=head1 DESCRIPTION + +Layout with left and right components, with content being part of the +right block. + +=head1 BUGS + +Due to the way content is serialized it's currently not possible to shift the content into the other blocks + +=head1 AUTHOR + +Sven Schöling Es.schoeling@linet-services.deE + +=cut