#!/usr/bin/perl
-#
-
-#$| = 1;
-
-#use CGI::Carp qw(fatalsToBrowser);
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};
-
-my $form = $main::form;
-my $locale = $main::locale;
-
-$form->header;
-my $paramstring = $ENV{"QUERY_STRING"};
-my @felder = split "&", $paramstring;
-my ($name, $wert);
-foreach (@felder) {
- ($name, $wert) = split "=", $_;
- $wert =~ tr/+/ /;
- $name = $wert;
-}
-my $login =
- "". $locale->text('User') . ": " . $form->{login}
- . " [<a href=\"login.pl?action=logout\" target=\"_top\" title=\"". $locale->text('Logout now') . "\">"
- . $locale->text('Logout')
- . "</a>] ";
-my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
- $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
- = localtime(time);
-my $CTIME_String = localtime(time);
-$Monat += 1;
-$Jahrestag += 1;
-$Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
-$Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
-$Jahr += 1900;
-my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
- "Donnerstag", "Freitag", "Samstag");
-my @Monatsnamen = ("", "Januar", "Februar", "März",
- "April", "Mai", "Juni", "Juli",
- "August", "September", "Oktober", "November",
- "Dezember");
-my $datum =
- $Wochentage[$Wochentag] . ", der "
- . $Monatstag . "."
- . $Monat . "."
- . $Jahr . " - ";
-
-#$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
-my $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
-print qq|
-<script type="text/javascript">
-<!--
-var clockid=new Array()
-var clockidoutside=new Array()
-var i_clock=-1
-var thistime= new Date()
-var hours= | . $Stunden . qq|;
-var minutes= | . $Minuten . qq|;
-var seconds= | . $Sekunden . qq|;
-if (eval(hours) <10) {hours="0"+hours}
-if (eval(minutes) < 10) {minutes="0"+minutes}
-if (seconds < 10) {seconds="0"+seconds}
-//var thistime = hours+":"+minutes+":"+seconds
-var thistime = hours+":"+minutes
-
-function writeclock() {
- i_clock++
- if (document.all \|\| document.getElementById \|\| document.layers) {
- clockid[i_clock]="clock"+i_clock
- document.write("<font family=arial size=2><span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span></font>")
- }
-}
-
-function clockon() {
- thistime= new Date()
- hours=thistime.getHours()
- minutes=thistime.getMinutes()
- seconds=thistime.getSeconds()
- if (eval(hours) <10) {hours="0"+hours}
- if (eval(minutes) < 10) {minutes="0"+minutes}
- if (seconds < 10) {seconds="0"+seconds}
- //thistime = hours+":"+minutes+":"+seconds
- thistime = hours+":"+minutes
-
- if (document.all) {
- for (i=0;i<=clockid.length-1;i++) {
- var thisclock=eval(clockid[i])
- thisclock.innerHTML=thistime
- }
- }
-
- if (document.getElementById) {
- for (i=0;i<=clockid.length-1;i++) {
- document.getElementById(clockid[i]).innerHTML=thistime
- }
- }
- var timer=setTimeout("clockon()",60000)
-}
-window.onload=clockon
-//-->
-</script>
-|;
+ %::myconfig = $::auth->read_user($::form->{login}) if $::form->{login};
+ $::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
-print qq|
-<body bgcolor="#ffffff" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="background-image: url('image/fade.png'); background-repeat:repeat-x;">
-<script language='JavaScript' src='js/switchmenuframe.js'></script>
-<table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
- <tr>|;
- if ( !($ENV{HTTP_USER_AGENT} =~ /links/i) ) { # do not show the the links in case of "links" in HTTP_USER_AGENT
- print qq|
- <td style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>
- [<a href="JavaScript:Switch_Menu();" title="| . $locale->text('Switch Menu on / off') . qq|">| . $locale->text('Menu') . qq|</a>]
- [<a HREF="login.pl" target="_blank" title="| . $locale->text('Open a further Lx-Office Window or Tab') . qq|">| . $locale->text('New Win/Tab') . qq|</a>]
- [<a href="JavaScript:top.main_window.print();" title="| . $locale->text('Hardcopy') . qq|">| . $locale->text('Print') . qq|</a>]
- [<a href="Javascript:top.main_window.history.back();" title="| . $locale->text('Go one step back') . qq|">| . $locale->text('Back') . qq|</a>]
- [<a href="Javascript:top.main_window.history.forward();" title="| . $locale->text('Go one step forward') . qq|">| . $locale->text('Fwd') . qq|</a>]
- </td>|;
- }
- print qq|
- <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
- . $login . $datum . qq| <script>writeclock()</script>
- </td>
- </tr>
-</table>
-</body>
-</html>
-|;
+ $::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;
--- /dev/null
+[%- 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>
+<body>
+ <table>
+ <tr>
+[% UNLESS is_links %]
+ <td nowrap>
+ [<a href="JavaScript:Switch_Menu();" title="[% 'Switch Menu on / off' | $T8 %]">[% 'Menu' | $T8 %]</a>]
+ [<a HREF="login.pl" target="_blank" title="[% 'Open a further Lx-Office Window or Tab' | $T8 %]">[% 'New Win/Tab' | $T8 %]</a>]
+ [<a href="JavaScript:top.main_window.print();" title="[% 'Hardcopy' | $T8 %]">[% 'Print' | $T8 %]</a>]
+ [<a href="Javascript:top.main_window.history.back();" title="[% 'Go one step back' | $T8 %]">[% 'Back' | $T8 %]</a>]
+ [<a href="Javascript:top.main_window.history.forward();" title="[% 'Go one step forward' | $T8 %]">[% 'Fwd' | $T8 %]</a>]
+ </td>
+[%- END %]
+[% IF show_debug %]
+ <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>]
+ </td>
+[%- END %]
+ <td align="right" nowrap>
+ [% 'User' | $T8 %]:
+ [% login %]
+ [<a href="login.pl?action=logout" target="_top" title="[% 'Logout now' | $T8 %]">[% 'Logout' | $T8 %]</a>]
+ [% now.to_lxoffice %] -
+ [% now.hms %]
+ </td>
+ </tr>
+ </table>
+</body>
+</html>