use SL::Layout::Top;
use SL::Layout::MenuLeft;
use SL::Layout::None;
+use SL::Layout::Split;
+use SL::Layout::Content;
sub init_sub_layouts {
[
SL::Layout::None->new,
SL::Layout::Top->new,
- SL::Layout::MenuLeft->new,
+ SL::Layout::Split->new(
+ left => [ SL::Layout::MenuLeft->new ],
+ right => [ SL::Layout::Content->new ],
+ )
]
}
--- /dev/null
+package SL::Layout::Content;
+
+use strict;
+use parent qw(SL::Layout::Base);
+
+use SL::Presenter;
+
+sub start_content {
+ "<div id='content'>";
+}
+
+sub end_content {
+ "</div>";
+}
+
+1;
+
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+SL::Layout::Content
+
+=head1 DESCRIPTION
+
+Pseudo layout for the position of the actual content in the layout. Currently
+only implements the start_content/end_content blocks used for styling.
+
+=head1 AUTHOR
+
+Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>
+
+=cut
use strict;
use parent qw(SL::Layout::Base);
+use SL::Layout::None;
+use SL::Layout::Top;
+use SL::Layout::Content;
+
use List::Util qw(max);
use URI;
[
SL::Layout::None->new,
SL::Layout::Top->new,
+ SL::Layout::Content->new,
]
}
);
}
-sub start_content {
- "<div id='content'>\n";
-}
-
-sub end_content {
- "</div>\n";
-}
-
sub stylesheets {
$_[0]->add_stylesheets(qw(
dhtmlsuite/menu-item.css
"<div id='html-menu'></div>\n";
}
-sub start_content {
- "<div id='content' class='html-menu'>\n";
-}
-
-sub end_content {
- "</div>\n";
-}
-
sub section_menu {
my ($menu) = @_;
my @items;
--- /dev/null
+package SL::Layout::Split;
+
+use strict;
+use parent qw(SL::Layout::Base);
+
+use SL::Presenter;
+
+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 || [] };
+
+ SL::Presenter->get->html_tag('div', $left, class => 't-layout-left')
+ .'<div class="t-layout-right html-menu">' . $right;
+}
+
+sub post_content {
+ my $left = join '', map { $_->post_content } @{ $_[0]->left || [] };
+ my $right = join '', map { $_->post_content } @{ $_[0]->right || [] };
+
+ $right . '</div>'
+ . SL::Presenter->get->html_tag('div', $left, class => 't-layout-left');
+}
+
+1;
+
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+SL::Layout::Split
+
+=head1 SYNOPSIS
+
+ use SL::Layout::TLayout;
+
+ SL::Layout::TLayout->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 E<lt>s.schoeling@linet-services.deE<gt>
+
+=cut
use SL::Layout::None;
use SL::Layout::Top;
use SL::Layout::CssMenu;
+use SL::Layout::Content;
sub init_sub_layouts {
[
SL::Layout::None->new,
SL::Layout::Top->new,
SL::Layout::CssMenu->new,
+ SL::Layout::Content->new,
]
}
-sub start_content {
- "<div id='content'>\n";
-}
-
-sub end_content {
- "</div>\n";
-}
1;
each line is a mi (menuitem) and has one mii (menu-item-icon) whcih is ms (menu-spacer)
and one mic (menu-item-chunk)
indenting is done with the levels s0, s1, s2 */
-#content.html-menu, #html-menu {
+div.layout-split-left, #html-menu {
transition: margin-left 0.2s, width 0.2s;
-moz-transition: margin-left 0.2s, width 0.2s;
-webkit-transition: margin-left 0.2s, width 0.2s;
-o-transition: margin-left 0.2s, width 0.2s;
}
-#content.html-menu { margin-left: 190px; }
-#content.html-menu.folded { margin-left: 40px }
-#html-menu.folded:hover + #content.html-menu.folded { margin-left: 190px }
+div.layout-split-right { margin-left: 190px; }
+div.layout-split-right.folded { margin-left: 40px }
+#html-menu.folded:hover + div.layout-split-right.folded { margin-left: 190px }
#html-menu { float:left; width: 183px; font-size: 8pt; margin-top: 10px; overflow:hidden; }
#html-menu.folded { width: 32px; }
#html-menu.folded:hover { width: 183px; }
each line is a mi (menuitem) and has one mii (menu-item-icon) whcih is ms (menu-spacer)
and one mic (menu-item-chunk)
indenting is done with the levels s0, s1, s2 */
-#content.html-menu, #html-menu {
+div.html-menu, #html-menu {
transition: margin-left 0.2s, width 0.2s;
-moz-transition: margin-left 0.2s, width 0.2s;
-webkit-transition: margin-left 0.2s, width 0.2s;
-o-transition: margin-left 0.2s, width 0.2s;
}
-#content.html-menu { margin-left: 190px; }
-#content.html-menu.folded { margin-left: 40px }
-#html-menu.folded:hover + #content.html-menu.folded { margin-left: 190px }
+div.layout-split-right { margin-left: 190px; }
+div.layout-split-right.folded { margin-left: 40px }
+#html-menu.folded:hover + #content.layout-split-right.folded { margin-left: 190px }
#html-menu { float:left; width: 183px; font-size: 85%; margin-top: 10px; overflow:hidden; }
#html-menu.folded { width: 32px; }
#html-menu.folded:hover { width: 183px; }