From: Holger Lindemann Date: Tue, 10 Feb 2009 14:48:55 +0000 (+0000) Subject: altes JS-Menu wieder aktiviert - ist nicht schön, aber funktioniert besser X-Git-Tag: release-2.6.0beta2~177 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=97908cc46138ad5476e4fb6d47693018f0176365;p=kivitendo-erp.git altes JS-Menu wieder aktiviert - ist nicht schön, aber funktioniert besser --- diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 7488dd18c..0d49058ae 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -137,6 +137,7 @@ sub login { my %style_to_script_map = ( 'v3' => 'v3', 'neu' => 'new', + 'js' => 'js', 'xml' => 'XML', ); diff --git a/bin/mozilla/menujs.pl b/bin/mozilla/menujs.pl new file mode 100644 index 000000000..b196fd560 --- /dev/null +++ b/bin/mozilla/menujs.pl @@ -0,0 +1,431 @@ +#===================================================================== +# LX-Office ERP +# Copyright (C) 2004 +# Based on SQL-Ledger Version 2.1.9 +# Web http://www.lx-office.org +# +###################################################################### +# SQL-Ledger Accounting +# Copyright (c) 1998-2002 +# +# Author: Dieter Simader +# Email: dsimader@sql-ledger.org +# Web: http://www.sql-ledger.org +# +# Contributors: Christopher Browne +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +####################################################################### +# +# thre frame layout with refractured menu +# +# CHANGE LOG: +# DS. 2002-03-25 Created +# 2004-12-14 - Holger Lindemann +####################################################################### + +$menufile = "menu.ini"; +use SL::Menu; +use CGI::Carp qw(fatalsToBrowser); + +1; + +# end of main + +sub display { + + $form->header; + + &clock_line; + + &acc_menu; + + print qq| + + + + +|; + +} + +sub clock_line { + + $fensterlink="menujs.pl?login=$form->{login}&password=$form->{password}&action=display"; + $fenster = "["."neues Fenster]"; + + $login = "[Nutzer " + . $form->{login} + . " - {"password"} + . "&action=logout\" target=\"_top\">" + . $locale->text('Logout') + . "] "; + 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"); + $datum = + $Wochentage[$Wochentag] . ", der " + . $Monatstag . "." + . $Monat . "." + . $Jahr . " - "; + + #$zeit="
".$Stunden.":".$Minuten.":".$Sekunden."
"; + $zeit = "
" . $Stunden . ":" . $Minuten . "
"; + print qq| + + + + + + +
  $fenster   [drucken] + $login $datum   +
+|; +} + +sub acc_menu { + $mainlevel = $form->{level}; + $mainlevel =~ s/$mainlevel--//g; + my $menu = new Menu "$menufile"; + + $| = 1; + + print qq| + + + + + + + + + + + +|; + + print qq| + +|; + +} + +sub section_menu { + my ($menu, $level) = @_; + + # build tiered menus + my @menuorder = $menu->access_control(\%myconfig, $level); + $main = 0; + + #$pm=0; + $shlp=0; + while (@menuorder) { + $item = shift @menuorder; + $label = $item; + $ml = $item; + $label =~ s/$level--//g; + $ml =~ s/--.*//; + $label = $locale->text($label); + $label =~ s/ / /g; + $menu->{$item}{target} = "main_window" unless $menu->{$item}{target}; + + if ($menu->{$item}{submenu}) { + $menu->{$item}{$item} = !$form->{$item}; + + # Untermen + if ($mlz{"s$ml"} > 1) { + $z++; + $sm = 1; + } else { + $z = $sm; + $mlz{"s$ml"}++; + } + print + qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, | + . ++$pm + . qq|);\n|; + $sm = 1; + print qq|menu[$pm] = new Array();\n|; + print + qq|menu[$pm][0] = new Menu(true, '', 85, 0, 180, defOver, defBack, 'itemBorder', 'itemText');\n|; + map { shift @menuorder } grep /^$item/, @menuorder; + §ion_menu($menu, $item); + map { shift @menuorder } grep /^$item/, @menuorder; + } else { + if ($menu->{$item}{module}) { + + #Untermenüpunkte + $target = $menu->{$item}{target}; + $uri = $menu->menuitem_js(\%myconfig, \%$form, $item, $level); + + print + qq|menu[$pm][$sm] = new Item('$label', '$uri', '$target', defLength, 0, 0);\n|; + $sm++; + } else { # Hauptmenu + my $ml_ = $form->escape($ml); + $mm++; + $pm++; + %mlz = ($ml, $pm, "s$ml", 1); + $shlp = $sm; + $sm = 1; + $breit = 15 + length($label) * 6; + print + qq|menu[0][$mm] = new Item(' $label', '#', '', $breit, 10, $pm); \n|; + print qq|menu[$pm] = new Array();\n|; + print + qq|menu[$pm][0] = new Menu(true, '>', 0, 20, 180, defOver, defBack, 'itemBorder', 'itemText');\n|; + + §ion_menu($menu, $item); + + #print qq|
\n|; + } + } + } +}