1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 ######################################################################
8 # SQL-Ledger Accounting
9 # Copyright (c) 1998-2002
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
15 # Contributors: Christopher Browne
17 # This program is free software; you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation; either version 2 of the License, or
20 # (at your option) any later version.
22 # This program is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #######################################################################
31 # thre frame layout with refractured menu
33 #######################################################################
35 $menufile = "menu.ini";
44 $form->header(qq|<link rel="stylesheet" href="css/menuv4.css?id=" type="text/css">|);
46 $form->{date} = clock_line();
47 $form->{menu} = acc_menu();
48 my $callback = $form->unescape($form->{callback});
49 $callback = URI->new($callback)->rel($callback) if $callback;
50 $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
51 $form->{callback} = $callback;
53 print $form->parse_html_template("menu/menuv4");
58 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
59 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
63 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
64 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
66 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
67 "Donnerstag", "Freitag", "Samstag");
68 my @Monatsnamen = ("", "Januar", "Februar", "März",
69 "April", "Mai", "Juni", "Juli",
70 "August", "September", "Oktober", "November",
73 $Wochentage[$Wochentag] . ", der "
80 $locale = Locale->new($myconfig{countrycode}, "menu");
82 $mainlevel = $form->{level};
83 $mainlevel =~ s/\Q$mainlevel\E--//g;
84 my $menu = new Menu "$menufile";
88 return print_menu($menu);
92 my ($menu, $parent, $depth) = @_;
95 die if ($depth * 1 > 5);
99 @menuorder = $menu->access_control(\%myconfig, $parent);
101 $parent .= "--" if ($parent);
103 foreach my $item (@menuorder) {
104 substr($item, 0, length($parent)) = "";
105 next if (($item eq "") || ($item =~ /--/));
107 my $menu_item = $menu->{"${parent}${item}"};
108 my $menu_title = $locale->text($item);
109 my $menu_text = $menu_title;
111 my $target = "main_window";
112 $target = $menu_item->{"target"} if ($menu_item->{"target"});
114 if ($menu_item->{"submenu"} || !defined($menu_item->{"module"}) ||
115 ($menu_item->{"module"} eq "menu.pl")) {
117 my $h = print_menu($menu, "${parent}${item}", $depth * 1 + 1)."\n";
119 $html .= qq|<ul><li><h2>${menu_text}</h2><ul>${h}</ul></li></ul>\n|;
121 $html .= qq|<li><div class="x">${menu_text}</div><ul>${h}</ul></li>\n|;
125 $html .= qq|<li class='sub'>|;
129 $html .= $menu->menuitem_v3(\%myconfig, $form, "${parent}$item",
130 { "title" => $menu_title,
131 "target" => $target });
132 $html .= qq|${menu_text}</a></li>\n|;