Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3e8a8c57

Von Sven Schöling vor mehr als 13 Jahren hinzugefügt

  • ID 3e8a8c572aa73c522df8c916d799cb30be276925
  • Vorgänger 97358b9b
  • Nachfolger 7d464f14

Debug Menü im HTML Menü. FCGI Entwicklung leicht gemacht.

Unterschiede anzeigen:

bin/mozilla/kopf.pl
1 1
#!/usr/bin/perl
2
#
3

  
4
#$| = 1;
5

  
6
#use CGI::Carp qw(fatalsToBrowser);
7 2

  
8 3
use strict;
4
use DateTime;
9 5

  
10 6
sub run {
11 7
  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
    "". $locale->text('User') . ": " . $form->{login}
29
  . "  [<a href=\"login.pl?action=logout\" target=\"_top\" title=\"". $locale->text('Logout now') . "\">"
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 8

  
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
|;
9
  %::myconfig = $::auth->read_user($::form->{login})  if $::form->{login};
10
  $::locale   = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
109 11

  
110
print qq|
111
<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;">
112
<script language='JavaScript' src='js/switchmenuframe.js'></script>
113
<table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
114
  <tr>|;
115
   if ( !($ENV{HTTP_USER_AGENT} =~ /links/i) ) {    # do not show the the links in case of "links" in HTTP_USER_AGENT
116
      print qq|
117
       <td  style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>
118
       [<a href="JavaScript:Switch_Menu();" title="| . $locale->text('Switch Menu on / off') . qq|">| . $locale->text('Menu') . qq|</a>]
119
       &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>]
120
       &nbsp;[<a href="JavaScript:top.main_window.print();" title="| . $locale->text('Hardcopy') . qq|">| . $locale->text('Print') . qq|</a>]
121
       &nbsp;[<a href="Javascript:top.main_window.history.back();" title="| . $locale->text('Go one step back') . qq|">| . $locale->text('Back') . qq|</a>]
122
       &nbsp;[<a href="Javascript:top.main_window.history.forward();" title="| . $locale->text('Go one step forward') . qq|">| . $locale->text('Fwd') . qq|</a>]
123
      </td>|;
124
   }
125
   print qq|
126
    <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
127
  . $login . $datum . qq| <script>writeclock()</script>&nbsp;
128
    </td>
129
  </tr>
130
</table>
131
</body>
132
</html>
133
|;
12
  $::form->header;
13
  print $::form->parse_html_template('menu/header', {
14
    now        => DateTime->now,
15
    show_debug => $::lx_office_conf{debug}{show_debug_menu},
16
    lxdebug    => $::lxdebug,
17
    is_links   => ($ENV{HTTP_USER_AGENT} =~ /links/i),
18
  });
134 19
}
135 20

  
136 21
1;

Auch abrufbar als: Unified diff