kivitendo/SL/Layout/Design40Switch.pm @ fe681ce4
f2ba0773 | Sven Schöling | package SL::Layout::Design40Switch;
|
||
use strict;
|
||||
use parent qw(SL::Layout::Base);
|
||||
sub is_design40 {
|
||||
$::myconfig{stylesheet} =~ /design40/i;
|
||||
}
|
||||
sub webpages_path {
|
||||
is_design40() ? "templates/design40_webpages" : $_[0]->SUPER::webpages_path
|
||||
}
|
||||
bf2b5e5d | Sven Schöling | sub webpages_fallback_path {
|
||
is_design40() ? "templates/webpages" : $_[0]->SUPER::webpages_fallback_path
|
||||
}
|
||||
f2ba0773 | Sven Schöling | sub allow_stylesheet_fallback {
|
||
!is_design40();
|
||||
}
|
||||
2b6e91d5 | Sven Schöling | sub html_dialect {
|
||
is_design40() ? 'html5' : $_[0]->SUPER::html_dialect
|
||||
}
|
||||
f2ba0773 | Sven Schöling | 1;
|
||
__END__
|
||||
=encoding utf-8
|
||||
=head1 NAME
|
||||
SL::Layout::Design40Switch - Layout switch for Design 4.0
|
||||
=head1 SYNOPSIS
|
||||
Detects whether the user selected the Design4.0 stylesheet, and if so,
|
||||
overrides some implementation details.
|
||||
=head1 DESCRIPTION
|
||||
Once activated, it will set the templates to use C<templates/design40_webpages> instead.
|
||||
It will also disable css fallback, so that common.css etc won't interfere.
|
||||
=head1 BUGS
|
||||
None yet. :)
|
||||
=head1 AUTHOR
|
||||
Sven Schöling $<lt>s.schoeling@googlemail.comE<gt>
|
||||
=cut
|