1 ######################################################################
2 # SQL-Ledger Accounting
3 # Copyright (c) 1998-2002
5 # Author: Dieter Simader
6 # Email: dsimader@sql-ledger.org
7 # Web: http://www.sql-ledger.org
9 # Contributors: Christopher Browne
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #######################################################################
25 # two frame layout with refractured menu
28 # DS. 2002-03-25 Created
29 #######################################################################
31 $menufile = "menu.ini";
41 $framesize = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "135";
47 <FRAMESET COLS="$framesize,*" BORDER="1">
49 <FRAME NAME="acc_menu" SRC="$form->{script}?login=$form->{login}&password=$form->{password}&action=acc_menu&path=$form->{path}">
50 <FRAME NAME="main_window" SRC="login.pl?login=$form->{login}&password=$form->{password}&action=company_logo&path=$form->{path}">
64 my $menu = new Menu "$menufile";
65 $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
66 $menu = new Menu "$form->{login}_$menufile" if (-f "$form->{login}_$menufile");
68 $form->{title} = $locale->text('Accounting Menu');
88 my ($menu, $level) = @_;
91 my @menuorder = $menu->access_control(\%myconfig, $level);
94 $item = shift @menuorder;
96 $label =~ s/$level--//g;
98 my $spacer = " " x (($item =~ s/--/--/g) * 2);
101 $label = $locale->text($label);
102 $label =~ s/ / /g;
104 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
106 if ($menu->{$item}{submenu}) {
107 $menu->{$item}{$item} = !$form->{$item};
109 if ($form->{level} && $item =~ /^$form->{level}/) {
112 print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
114 # remove same level items
115 map { shift @menuorder } grep /^$item/, @menuorder;
117 §ion_menu($menu, $item);
123 print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label ...</a>|;
125 # remove same level items
126 map { shift @menuorder } grep /^$item/, @menuorder;
133 if ($menu->{$item}{module}) {
134 if ($form->{$item} && $form->{level} eq $item) {
135 $menu->{$item}{$item} = !$form->{$item};
136 print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
138 # remove same level items
139 map { shift @menuorder } grep /^$item/, @menuorder;
141 §ion_menu($menu, $item);
144 print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
149 print qq|<br><b>$label</b>|;
151 §ion_menu($menu, $item);