sub action_reload {
my ($self, %params) = @_;
- print $::cgi->redirect('kopf.pl');
+ print $::cgi->redirect('controller.pl?action=FrameHeader/header');
exit;
}
my ($self, %params) = @_;
$::lxdebug->level_by_name($::form->{level}, !$::lxdebug->level_by_name($::form->{level}));
- print $::cgi->redirect('kopf.pl');
+ print $::cgi->redirect('controller.pl?action=FrameHeader/header');
return;
}
--- /dev/null
+package SL::Controller::FrameHeader;
+
+use strict;
+use parent qw(SL::Controller::Base);
+
+sub action_header {
+ my ($self) = @_;
+
+ delete $::form->{stylesheet};
+ $::form->use_stylesheet('frame_header/header.css');
+ $self->render('menu/header',
+ now => DateTime->now_local,
+ is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i),
+ is_links => scalar($ENV{HTTP_USER_AGENT} =~ /links/i));
+}
+
+1;
$::form->error($::locale->text('System currently down for maintenance!')) if -e ($::lx_office_conf{paths}->{userspath} . "/nologin") && $script ne 'admin';
- if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') {
+ if ($script eq 'login' or $script eq 'admin') {
$::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}";
::run($session_result);
return $output;
}
+sub use_stylesheet {
+ my $self = shift;
+
+ $self->{stylesheet} = [ $self->{stylesheet} ] unless ref $self->{stylesheet} eq 'ARRAY';
+ $self->{stylesheet} = [ grep { -f }
+ map { m:^css/: ? $_ : "css/$_" }
+ grep { $_ }
+ (@{ $self->{stylesheet} }, @_)
+ ];
+
+ return @{ $self->{stylesheet} };
+}
sub header {
$::lxdebug->enter_sub;
push @header, "<meta http-equiv='refresh' content='$refresh_time;$refresh_url'>";
}
- push @header, "<link rel='stylesheet' href='css/$_' type='text/css' title='Lx-Office stylesheet'>"
- for grep { -f "css/$_" } apply { s|.*/|| } $self->{stylesheet}, $self->{stylesheets};
+ push @header, map { qq|<link rel="stylesheet" href="$_" type="text/css" title="Lx-Office stylesheet">| } $self->use_stylesheet;
push @header, "<style type='text/css'>\@page { size:landscape; }</style>" if $self->{landscape};
push @header, "<link rel='shortcut icon' href='$self->{favicon}' type='image/x-icon'>" if -f $self->{favicon};
# Leere Datumseingabe i.O.
# SELECT 1 FROM defaults WHERE '' < closedto
# normale Zahlungsbuchung über Rechnungsmaske i.O.
- # SELECT 1 FROM defaults WHERE '10.05.2011' < closedto
+ # SELECT 1 FROM defaults WHERE '10.05.2011' < closedto
# Testfälle mit definiertem closedto (30.04.2011):
# Leere Datumseingabe i.O.
# SELECT 1 FROM defaults WHERE '' < closedto
=head2 C<header>
Generates a general purpose http/html header and includes most of the scripts
-ans stylesheets needed.
+and stylesheets needed. Stylesheets can be added with L<use_stylesheet>.
Only one header will be generated. If the method was already called in this
request it will not output anything and return undef. Also if no
=item stylesheet
-=item stylesheets
-
-If these are arrayrefs the contents will be inlined into the header.
+Either a scalar or an array ref. Will be inlined into the header. Add
+stylesheets with the L<use_stylesheet> function.
=item landscape
push(@ { $form->{AJAX} }, $pjx);
- $form->{stylesheets} = "list_accounts.css";
+ $form->use_stylesheet("list_accounts.css");
$form->{title} = $locale->text('Chart of Accounts');
$form->header;
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use DateTime;
-
-sub run {
- my $session_result = shift;
-
- %::myconfig = $::auth->read_user($::form->{login}) if $::form->{login};
- $::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
-
- $::form->header;
- print $::form->parse_html_template('menu/header', {
- now => DateTime->now,
- show_debug => $::lx_office_conf{debug}{show_debug_menu},
- lxdebug => $::lxdebug,
- is_links => ($ENV{HTTP_USER_AGENT} =~ /links/i),
- });
-}
-
-1;
-
-#
print qq|
<frameset rows="28px,*" cols="*" framespacing="0" frameborder="0">
- <frame src="kopf.pl" name="kopf" scrolling="NO">
+ <frame src="controller.pl?action=FrameHeader/header" scrolling="NO">
<frameset cols="$framesize,*" framespacing="0" frameborder="0" border="0" id="menuframe" name="menuframe">
<frame src="$::form->{script}?action=acc_menu" name="acc_menu" scrolling="auto" noresize marginwidth="0">
<frame src="$callback" name="main_window" scrolling="auto">
# default.
watch_form = 0
-# Include menu options for debugging in the HTML menu
+# Include menu options for debugging in the HTML menu. Works only in
+# FastCGI mode.
show_debug_menu = 0
# If you want to debug the creation of LaTeX files then set this to 1.
--- /dev/null
+body {
+ margin: 0;
+ color: white;
+ background: url('../../image/fade.png') repeat-x;
+}
+
+a:link, a:visited, a:hover, a:active {
+ color: white;
+}
+
+body > * {
+ font-size: 12px;
+ font-family: verdana,arial,sans-serif;
+ vertical-align: middle;
+}
+
+table {
+ border: 0;
+ width: 100%;
+ background: url('../../image/bg_titel.gif');
+ border-spacing: 0;
+}
+
+td {
+ padding: 0;
+}
-/* This is used in bin/mozilla/kopf.pl to switch the HTML side menu on/off
- 2010, Sven Donath, lxo@dexo.de */
-
var vSwitch_Menu = 1;
var FrameSize = (parent.document.getElementById('menuframe').cols);
#!/bin/sh
-for i in am dispatcher kopf login; do
+for i in am dispatcher login; do
rm $i.pl 2> /dev/null
ln -s admin.pl $i.pl
done
-for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do
+for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do
rm $i.pl 2> /dev/null
ln -s am.pl $i.pl
done
[%- USE T8 %]
-<style type='text/css'>
- body { margin: 0; color: white; background: url('image/fade.png') repeat-x; }
- a:link, a:visited, a:hover, a:active { color:white }
- body > * { font-size: 12px; font-family:verdana,arial,sans-serif; vertical-align:middle; }
- table { border:0; width: 100%; background: url('image/bg_titel.gif'); border-spacing:0; }
- td { padding: 0 }
-</style>
-<script language='javascript' src='js/switchmenuframe.js'></script>
+<script language="javascript" src="js/switchmenuframe.js"></script>
<body>
<table>
<tr>
[<a href="Javascript:top.main_window.history.forward();" title="[% 'Go one step forward' | $T8 %]">[% 'Fwd' | $T8 %]</a>]
</td>
[%- END %]
-[% IF show_debug %]
+[% IF is_fastcgi && LXCONFIG.debug.show_debug_menu %]
<td align='center' nowrap>
Debug:
[<a href='controller.pl?action=DebugMenu/reload']>FCGI Reload</a>]
- [<a href='controller.pl?action=DebugMenu/toggle&level=request_timer'>[% IF lxdebug.level_by_name('request_timer') %]<b>Timing</b>[% ELSE %]Timing[% END %]</a>]
- [<a href='controller.pl?action=DebugMenu/toggle&level=trace'>[% IF lxdebug.level_by_name('trace') %]<b>Trace</b>[% ELSE %]Trace[% END %]</a>]
- [<a href='controller.pl?action=DebugMenu/toggle&level=query'>[% IF lxdebug.level_by_name('query') %]<b>Query</b>[% ELSE %]Query[% END %]</a>]
+ [<a href='controller.pl?action=DebugMenu/toggle&level=request_timer'>[% IF LXDEBUG.level_by_name('request_timer') %]<b>Timing</b>[% ELSE %]Timing[% END %]</a>]
+ [<a href='controller.pl?action=DebugMenu/toggle&level=trace'>[% IF LXDEBUG.level_by_name('trace') %]<b>Trace</b>[% ELSE %]Trace[% END %]</a>]
+ [<a href='controller.pl?action=DebugMenu/toggle&level=query'>[% IF LXDEBUG.level_by_name('query') %]<b>Query</b>[% ELSE %]Query[% END %]</a>]
</td>
[%- END %]
<td align="right" nowrap>