1 ######################################################################
2 # SQL-Ledger Accounting
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
27 #######################################################################
29 $menufile = "menu.ini";
39 $menuwidth = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "155";
40 $menuwidth = $myconfig{menuwidth} if $myconfig{menuwidth};
46 <FRAMESET COLS="$menuwidth,*" BORDER="1">
48 <FRAME NAME="acc_menu" SRC="$form->{script}?login=$form->{login}&sessionid=$form->{sessionid}&action=acc_menu&path=$form->{path}">
49 <FRAME NAME="main_window" SRC="am.pl?login=$form->{login}&sessionid=$form->{sessionid}&action=company_logo&path=$form->{path}">
63 my $menu = new Menu "$menufile";
64 $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
65 $menu = new Menu "$form->{login}_$menufile" if (-f "$form->{login}_$menufile");
67 $form->{title} = $locale->text('Accounting Menu');
87 my ($menu, $level) = @_;
90 my @menuorder = $menu->access_control(\%myconfig, $level);
93 $item = shift @menuorder;
95 $label =~ s/$level--//g;
97 my $spacer = " " x (($item =~ s/--/--/g) * 2);
100 $label = $locale->text($label);
101 $label =~ s/ / /g if $label !~ /<img /i;
103 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
105 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;
132 if ($menu->{$item}{module}) {
134 print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
139 print qq|<a name="id$form->{tag}"></a>
142 §ion_menu($menu, $item);