Seitliches Menü mit den Icons des XUL-Menüs in 24x24 versehen.
[kivitendo-erp.git] / bin / mozilla / kopf.pl
1 #!/usr/bin/perl
2 #
3
4 #$| = 1;
5
6 #use CGI::Carp qw(fatalsToBrowser);
7
8 use strict;
9
10 sub run {
11   my $session_result = shift;
12   %::myconfig = $::auth->read_user($::form->{login})  if  $::form->{login};
13   $::locale   = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
14
15 my $form     = $main::form;
16 my $locale   = $main::locale;
17
18 $form->header;
19 my $paramstring = $ENV{"QUERY_STRING"};
20 my @felder = split "&", $paramstring;
21 my ($name, $wert);
22 foreach (@felder) {
23   ($name, $wert) = split "=", $_;
24   $wert =~ tr/+/ /;
25   $name = $wert;
26 }
27 my $login =
28     "[" . $form->{login}
29   . " - <a href=\"login.pl?action=logout\" target=\"_top\">"
30   . $locale->text('Logout')
31   . "</a>] ";
32 my ($Sekunden, $Minuten,   $Stunden,   $Monatstag, $Monat,
33     $Jahr,     $Wochentag, $Jahrestag, $Sommerzeit)
34   = localtime(time);
35 my $CTIME_String = localtime(time);
36 $Monat     += 1;
37 $Jahrestag += 1;
38 $Monat     = $Monat < 10     ? $Monat     = "0" . $Monat     : $Monat;
39 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
40 $Jahr += 1900;
41 my @Wochentage = ("Sonntag",    "Montag",  "Dienstag", "Mittwoch",
42                   "Donnerstag", "Freitag", "Samstag");
43 my @Monatsnamen = ("",       "Januar",    "Februar", "M&auml;rz",
44                    "April",  "Mai",       "Juni",    "Juli",
45                    "August", "September", "Oktober", "November",
46                    "Dezember");
47 my $datum =
48     $Wochentage[$Wochentag] . ", der "
49   . $Monatstag . "."
50   . $Monat . "."
51   . $Jahr . " - ";
52
53 #$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
54 my $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
55
56 print qq|
57 <script type="text/javascript">
58 <!--
59 var clockid=new Array()
60 var clockidoutside=new Array()
61 var i_clock=-1
62 var thistime= new Date()
63 var hours= | . $Stunden . qq|;
64 var minutes= | . $Minuten . qq|;
65 var seconds= | . $Sekunden . qq|;
66 if (eval(hours) <10) {hours="0"+hours}
67 if (eval(minutes) < 10) {minutes="0"+minutes}
68 if (seconds < 10) {seconds="0"+seconds}
69 //var thistime = hours+":"+minutes+":"+seconds
70 var thistime = hours+":"+minutes
71
72 function writeclock() {
73   i_clock++
74   if (document.all \|\| document.getElementById \|\| document.layers) {
75     clockid[i_clock]="clock"+i_clock
76     document.write("<font family=arial size=2><span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span></font>")
77   }
78 }
79
80 function clockon() {
81   thistime= new Date()
82   hours=thistime.getHours()
83   minutes=thistime.getMinutes()
84   seconds=thistime.getSeconds()
85   if (eval(hours) <10) {hours="0"+hours}
86   if (eval(minutes) < 10) {minutes="0"+minutes}
87   if (seconds < 10) {seconds="0"+seconds}
88   //thistime = hours+":"+minutes+":"+seconds
89   thistime = hours+":"+minutes
90
91   if (document.all) {
92     for (i=0;i<=clockid.length-1;i++) {
93       var thisclock=eval(clockid[i])
94       thisclock.innerHTML=thistime
95     }
96   }
97
98   if (document.getElementById) {
99     for (i=0;i<=clockid.length-1;i++) {
100       document.getElementById(clockid[i]).innerHTML=thistime
101     }
102   }
103   var timer=setTimeout("clockon()",60000)
104 }
105 window.onload=clockon
106 //-->
107 </script>
108 |;
109
110 #
111 print qq|
112 <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;">
113
114 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
115   <tr>
116     <td  style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;">
117       &nbsp;[<a href="JavaScript:top.main_window.print();" title="| . $locale->text('Hardcopy') . qq|">| . $locale->text('Print') . qq|</a>]
118       &nbsp;[<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>]
119       &nbsp;[<a href="Javascript:top.main_window.history.back();" title="| . $locale->text('Go one step back') . qq|">| . $locale->text('Back') . qq|</a>]
120       &nbsp;[<a href="Javascript:top.main_window.history.forward();" title="| . $locale->text('Go one step forward') . qq|">| . $locale->text('Fwd') . qq|</a>]
121       <!-- is there a better solution for Back? Possibly with the callback variable? -->
122     </td>
123     <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
124   . $login . $datum . qq| <script>writeclock()</script>&nbsp;
125     </td>
126   </tr>
127 </table>
128 </body>
129 </html>
130 |;
131
132 }
133
134 1;
135
136 #