Menü zeigt aus Platzgründen nur Top-Level Einträge in der menu.yml an.
use SL::Layout::Classic;
use SL::Layout::V3;
use SL::Layout::Javascript;
+use SL::Layout::Material;
+use SL::Layout::MobileLogin;
sub new {
my ($class, %params) = @_;
return SL::Layout::Admin->new if $params{style} eq 'admin';
return SL::Layout::AdminLogin->new if $params{style} eq 'admin_login';
return SL::Layout::Login->new if $params{style} eq 'login';
+ return SL::Layout::Material->new if $params{style} eq 'mobile';
+ return SL::Layout::MobileLogin->new if $params{style} eq 'mobile_login';
return SL::Layout::None->new;
}
--- /dev/null
+package SL::Layout::Material;
+
+use strict;
+use parent qw(SL::Layout::Base);
+
+use SL::Layout::None;
+use SL::Layout::MaterialMenu;
+use SL::Layout::MaterialStyle;
+use SL::Layout::Content;
+
+sub get_stylesheet_for_user {
+ # overwrite kivitendo fallback
+ 'css/material';
+}
+
+sub init_sub_layouts {
+ [
+ SL::Layout::None->new,
+ SL::Layout::MaterialStyle->new,
+ SL::Layout::MaterialMenu->new,
+ SL::Layout::Content->new,
+ ]
+}
+
+1;
--- /dev/null
+package SL::Layout::MaterialMenu;
+
+use strict;
+use parent qw(SL::Layout::Base);
+use SL::Menu;
+use SL::Controller::Base;
+
+sub init_menu {
+ SL::Menu->new('mobile');
+}
+
+sub pre_content {
+ $_[0]->presenter->render('menu/material', menu => $_[0]->menu, C => SL::Controller::Base->new);
+}
+
+1;
--- /dev/null
+package SL::Layout::MaterialStyle;
+
+use strict;
+use parent qw(SL::Layout::Base);
+
+sub use_stylesheet {
+ "https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css",
+ "https://fonts.googleapis.com/icon?family=Material+Icons";
+}
+
+sub use_javascript {
+ "https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js";
+}
+
+sub javascripts_inline {
+ "M.AutoInit();";
+}
+
+sub get_stylesheet_for_user {
+ # overwrite kivitendo fallback
+ 'css/material';
+}
+
+1;
--- /dev/null
+package SL::Layout::MobileLogin;
+
+use strict;
+use parent qw(SL::Layout::Base);
+use SL::Layout::MaterialStyle;
+use SL::Layout::MaterialMenu;
+
+sub get_stylesheet_for_user {
+ # overwrite kivitendo fallback
+ 'css/material';
+}
+
+sub init_sub_layouts {
+ [
+ SL::Layout::None->new,
+ SL::Layout::MaterialStyle->new,
+ SL::Layout::MaterialMenu->new,
+ ]
+}
+
+1;
--- /dev/null
+# This is the main menu config file for mobile user space menu entries.
+#
+# Th structure is the same as in user/, but currently infinite nesting is not supported.
+#
+---
+- id: test_entry
+ name: Test
+ icon: test
+ order: 100
+ access: customer_vendor_edit|customer_vendor_all_edit
+ params:
+ action: CustomerVendor/add
+ db: customer
+- id: warehouse_produce_assembly
+ name: Produce Assembly
+ icon: assembly_produce
+ order: 200
+ access: warehouse_management
+ module: wh.pl
+ params:
+ action: transfer_warehouse_selection
+ trans_type: assembly
+- id: warehouse_transfer
+ name: Transfer
+ order: 300
+ access: warehouse_management
+ module: wh.pl
+ params:
+ action: transfer_warehouse_selection
+ trans_type: transfer
+- id: warehouse_removal
+ name: Removal
+ order: 400
+ access: warehouse_management
+ module: wh.pl
+ params:
+ action: transfer_warehouse_selection
+ trans_type: removal
--- /dev/null
+[%- USE T8 %]
+[%- USE L %]
+[%- USE HTML %]
+[%- USE LxERP -%]
+<nav>
+ <div class="nav-wrapper">
+ <a class="brand-logo">Kivitendo</a>
+ <a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
+ <ul id="nav" class="right hide-on-med-and-down">
+ [% PROCESS menu_items %]
+ </ul>
+ </div>
+</nav>
+
+<ul id="nav-mobile" class="sidenav">
+ [% PROCESS menu_items %]
+</ul>
+
+
+[%- BLOCK menu_items %]
+ [%- IF MYCONFIG.login %]
+ <li><a>[% 'User' | $T8 %]: [% MYCONFIG.login | html %]</a></li>
+ [%- ELSE %]
+ <li>[% L.link(C.url_for(controller='LoginScreen', action='user_login'), LxERP.t8('Login')) %]</li>
+ [%- END %]
+
+ <li><div class="divider"></div></li>
+
+ [%- FOREACH node = menu.tree %]
+ [%- NEXT UNLESS node.visible %]
+ <li>[% L.link(menu.href_for_node(node) || '#', menu.name_for_node(node), target=node.target) %]</li>
+ [%- END %]
+
+ <li><div class="divider"></div></li>
+
+ [%- IF MYCONFIG.login %]
+ <li>[% L.link(C.url_for(controller='LoginScreen', action='logout'), LxERP.t8('Logout')) %]</li>
+ [%- END %]
+[% END %]