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
34 # DS. 2002-03-25 Created
35 # 2004-12-14 - New Optik - Marco Welter <mawe@linux-studio.de>
36 #######################################################################
38 $menufile = "menu.ini";
46 $framesize = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "190";
49 $lxdebug->enter_sub();
54 <frameset rows="28px,*" cols="*" framespacing="0" frameborder="0">
55 <frame src="kopf.pl?login=$form->{login}&password=$form->{password}&path=$form->{path}" name="kopf" scrolling="NO">
56 <frameset cols="$framesize,*" framespacing="0" frameborder="0" border="0" >
57 <frame src="$form->{script}?login=$form->{login}&password=$form->{password}&action=acc_menu&path=$form->{path}" name="acc_menu" scrolling="auto" noresize marginwidth="0">
58 <frame src="login.pl?login=$form->{login}&password=$form->{password}&action=company_logo&path=$form->{path}" name="main_window" scrolling="auto">
61 You need a browser that can read frames to see this page.
67 $lxdebug->leave_sub();
71 $lxdebug->enter_sub();
72 $mainlevel = $form->{level};
73 $mainlevel =~ s/$mainlevel--//g;
74 my $menu = new Menu "$menufile";
75 $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
76 $menu = new Menu "$form->{login}_$menufile"
77 if (-f "$form->{login}_$menufile");
79 $form->{title} = $locale->text('Accounting Menu');
87 print qq|<div align="left">\n<table width="|
93 print qq|</table></div>|;
99 $lxdebug->leave_sub();
103 $lxdebug->enter_sub();
104 my ($menu, $level) = @_;
107 my @menuorder = $menu->access_control(\%myconfig, $level);
109 $item = shift @menuorder;
112 $label =~ s/$level--//g;
114 if ($ml eq $mainlevel) { $zeige = 1; }
116 my $spacer = " " x (($item =~ s/--/--/g) * 1);
118 $label_icon = $label . ".gif";
120 $label = $locale->text($label);
122 # multi line hack, sschoeling jul06
123 # if a label is too long, try to split it at whitespaces, then join it to chunks of less
124 # than 20 chars and store it in an array.
125 # use this array later instead of the -ed label
127 my ($i,$l) =(-1, 20);
130 if ($l < 20) { $chunks[$i] .= " $_";
131 } else { $l =length $_; $chunks[++$i] = $_; }
133 map { $chunks[$_] =~ s/ / / } 0..$#chunks;
136 $label =~ s/ / /g;
137 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
139 if ($menu->{$item}{submenu}) {
140 $menu->{$item}{$item} = !$form->{$item};
141 if ($form->{level} && $item =~ /^$form->{level}/) {
146 qq|<tr><td valign=bottom><b>$spacer<img src="image/unterpunkt.png">$label</b></td></tr>\n|;
149 # remove same level items
150 map { shift @menuorder } grep /^$item/, @menuorder;
151 §ion_menu($menu, $item);
155 . $menu->menuitem(\%myconfig, \%$form, $item, $level)
156 . qq|$label ...</a></td></tr>\n|;
159 # remove same level items
160 map { shift @menuorder } grep /^$item/, @menuorder;
163 if ($menu->{$item}{module}) {
164 if ($form->{$item} && $form->{level} eq $item) {
165 $menu->{$item}{$item} = !$form->{$item};
168 qq|<tr><td valign=bottom>$spacer<img src="image/unterpunkt.png">|
169 . $menu->menuitem(\%myconfig, \%$form, $item, $level)
170 . qq|$label</a></td></tr>\n|;
173 # remove same level items
174 map { shift @menuorder } grep /^$item/, @menuorder;
175 §ion_menu($menu, $item);
178 if (scalar @chunks <= 1) {
180 qq|<tr><td class="hover" height="13" >$spacer<img src="image/unterpunkt.png" style="vertical-align:text-top">|
181 . $menu->menuitem(\%myconfig, \%$form, $item, $level)
182 . qq|$label</a></td></tr>\n|;
184 my $tmpitem = $menu->menuitem(\%myconfig, \%$form, $item, $level);
186 qq|<tr><td class="hover" height="13" >$spacer<img src="image/unterpunkt.png" style="vertical-align:text-top">|
188 . qq|$chunks[0]</a></td></tr>\n|;
191 qq|<tr style="vertical-align:top""><td class="hover">$spacer<img src="image/unterpunkt.png" style="visibility:hidden; width:23; height=2;">|
193 . qq|$chunks[$_]</a></td></tr>\n|;
199 my $ml_ = $form->escape($ml);
201 qq|<tr><td class="bg" height="22" align="left" valign="middle" ><img src="image/$item.png" style="vertical-align:middle"> <a href="menu.pl?path=bin/mozilla&action=acc_menu&level=$ml_&login=$form->{login}&password=$form->{password}" class="nohover">$label</a> </td></tr>\n|;
202 §ion_menu($menu, $item);
208 $lxdebug->leave_sub();