</script>
|;
-#
-my $framesize = _calc_framesize(); # framesize calculation as in menu.pl is only a quick and dirty hack here
- # it would be better to use a global or config variable
-
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>
- <td style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>
- [<a href="JavaScript:Switch_Menu(|.$framesize.qq|);" 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>]
- <!-- is there any better solution for Back? Possibly with the callback variable? -->
- </td>
+ <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>
</body>
</html>
|;
-
-sub _calc_framesize {
- my $is_lynx_browser = $ENV{HTTP_USER_AGENT} =~ /links/i;
- my $is_mobile_browser = $ENV{HTTP_USER_AGENT} =~ /mobile/i;
- my $is_mobile_style = $::form->{stylesheet} =~ /mobile/i;
-
- return $is_mobile_browser && $is_mobile_style ? 130
- : $is_lynx_browser ? 240
- : 180;
-}
-
}
1;
# CHANGE LOG:
# DS. 2002-03-25 Created
# 2004-12-14 - New Optik - Marco Welter <mawe@linux-studio.de>
-# 2010-08-19 - Icons for sub entries and one click
+# 2010-08-19 - Icons for sub entries and single click behavior, unlike XUL-Menu
# JS switchable HTML-menu - Sven Donath <lxo@dexo.de>
#######################################################################
sub display {
$main::lxdebug->enter_sub();
- my $form = $main::form;
+ my $form = $main::form;
- my $callback = $form->unescape($form->{callback});
- $callback = URI->new($callback)->rel($callback) if $callback;
- $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
- my $framesize = _calc_framesize();
+ my $callback = $form->unescape($form->{callback});
+ $callback = URI->new($callback)->rel($callback) if $callback;
+ $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
+ my $framesize = _calc_framesize();
$form->header;
my $form = $main::form;
my $locale = $main::locale;
- my $framesize = _calc_framesize(); # how to get it into kopf.pl or vice versa?
+ my $framesize = _calc_framesize();
$mainlevel = $form->{level};
$mainlevel =~ s/\Q$mainlevel\E--//g;
print qq|
<body class="menu">
-
-|;
+
+|;
print qq|<div align="left">\n<table width="|
- . $framesize
+ . ($framesize-2)
. qq|" border="0">\n|;
§ion_menu($menu);
$main::lxdebug->enter_sub();
my ($menu, $level) = @_;
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+ my $is_links_browser = 1;
+ if ( _calc_framesize() eq 240) { $is_links_browser = 0; }
my $zeige;
if ($zeige) {
if (scalar @chunks <= 1) {
print
- qq|<tr><td class="hover" height="16" >$spacer|
+ qq|<tr><td class="hover" height="16" >$spacer|
. $menu->menuitem(\%myconfig, \%$form, $item, $level) ;
-
- if (-f "image/icons/16x16/$label_icon")
- { print
- qq|<img src="image/icons/16x16/$label_icon" border="0" style="vertical-align:text-top" title="|
- . $label
- . qq|"> | }
+
+ if (-f "image/icons/16x16/$label_icon" && ($is_links_browser))
+ { print
+ qq|<img src="image/icons/16x16/$label_icon" border="0" style="vertical-align:text-top" title="|
+ . $label
+ . qq|"> | }
else {
- print qq|<img src="image/unterpunkt.png" border="0" style="vertical-align:text-top">|;
+ if ($is_links_browser) {
+ print qq|<img src="image/unterpunkt.png" border="0" style="vertical-align:text-top">|;
+ }
}
-
+
print
qq|$label</a></td></tr>\n|;
} else {
} else {
my $ml_ = $form->escape($ml);
print
- qq|<tr><td class="bg" height="24" align="left" valign="middle"><a href="menu.pl?action=acc_menu&level=$ml_" class="nohover" title="$label"><img src="image/icons/24x24/$item.png" border="0" style="vertical-align:middle" title="$label"> $label</a> </td></tr>\n|;
+ qq|<tr><td class="bg" height="24" align="left" valign="middle">
+ <a href="menu.pl?action=acc_menu&level=$ml_" class="nohover" title="$label">|;
+ if ($is_links_browser) {
+ print qq|<img src="image/icons/24x24/$item.png" border="0" style="vertical-align:middle" title="$label">|;
+ }
+ print qq| $label</a> </td></tr>\n|;
§ion_menu($menu, $item);
print qq|\n|;
return $is_mobile_browser && $is_mobile_style ? 130
: $is_lynx_browser ? 240
- : 180;
+ : 200;
}
1;
-/* This is used in bin/mozilla/kopf.pl to switch the HTML sidemenu on/off
+/* 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);
-function Switch_Menu(framesize)
+function Switch_Menu()
{
- if (vSwitch_Menu)
- {
- vSwitch_Menu=false;
- parent.document.getElementById('menuframe').setAttribute('cols','30,*')
- }
- else
- {
- vSwitch_Menu=true;
- framesize = framesize + ',*';
- parent.document.getElementById('menuframe').setAttribute('cols',framesize);
+ if (vSwitch_Menu)
+ {
+ vSwitch_Menu=false;
+ parent.document.getElementById('menuframe').setAttribute('cols','30,*');
}
- return;
+ else
+ {
+ vSwitch_Menu=true;
+ parent.document.getElementById('menuframe').setAttribute('cols',FrameSize);
+ }
+ return;
}