471d6128dc01303baa7869a890a32336a954f180
[kivitendo-erp.git] / SL / Layout / Top.pm
1 package SL::Layout::Top;
2
3 use strict;
4 use parent qw(SL::Layout::Base);
5
6 use SL::Controller::TopQuickSearch;
7
8 sub pre_content {
9   my ($self) = @_;
10
11   my @options;
12   # Only enable the quick search functionality if all database
13   # upgrades have already been applied as quick search requires
14   # certain columns that are only created by said database upgrades.
15   push @options, (quick_search => SL::Controller::TopQuickSearch->new) unless $::request->applying_database_upgrades;
16
17   $self->presenter->render('menu/header',
18     now        => DateTime->now_local,
19     is_fastcgi => $::dispatcher ? scalar($::dispatcher->interface_type =~ /fastcgi/i) : 0,
20     is_links   => scalar($ENV{HTTP_USER_AGENT}         =~ /links/i),
21     @options,
22   );
23 }
24
25 sub static_stylesheets {
26  'frame_header/header.css';
27 }
28
29 sub static_javascripts {
30   'jquery-ui.js',
31   'kivi.QuickSearch.js',
32 }
33
34 1;
35
36 __END__
37
38 =encoding utf-8
39
40 =head1 NAME
41
42 SL::Layout::Top - Top line in classic and v3 menu.
43
44 =head1 DOM MODEL
45
46 The entire top line is rendered into a div with id C<frame-header>. The following classes are used:
47
48   frame-header-element: any continuous block of entries
49   frame-header-left:    the left floating part
50   frame-header-right:   the right floating part
51   frame-header-center:  the centered part
52
53 =head1 BUGS
54
55 none yet. :)
56
57 =head1 AUTHOR
58
59 Sven Schoeling E<lt>s.schoeling@linet-services.deE<gt>
60
61 =cut