1 ######################################################################
2 # SQL-Ledger Accounting
5 # Author: Dieter Simader
6 # Email: dsimader@sql-ledger.org
7 # Web: http://www.sql-ledger.org
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #######################################################################
24 $menufile = "menu.ini";
34 $menuwidth = ($myconfig{menuwidth}) ? $myconfig{menuwidth} : ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "155";
40 <FRAMESET COLS="$menuwidth,*" BORDER="1">
42 <FRAME NAME="acc_menu" SRC="$form->{script}?login=$form->{login}&sessionid=$form->{sessionid}&action=acc_menu&path=$form->{path}">
43 <FRAME NAME="main_window" SRC="am.pl?login=$form->{login}&sessionid=$form->{sessionid}&action=company_logo&path=$form->{path}">
56 my $menu = new Menu "$menufile";
57 $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
58 $menu = new Menu "$form->{login}_$menufile" if (-f "$form->{login}_$menufile");
60 $form->{title} = $locale->text('Accounting Menu');
65 <script type="text/javascript">
66 function SwitchMenu(obj) {
67 if (document.getElementById) {
68 var el = document.getElementById(obj);
69 var ar = document.getElementById("cont").getElementsByTagName("DIV");
71 if (el.style.display == "none") {
72 el.style.display = "block"; //display the block of info
74 el.style.display = "none";
79 function ChangeClass(menu, newClass) {
80 if (document.getElementById) {
81 document.getElementById(menu).className = newClass;
84 document.onselectstart = new Function("return false");
101 my ($menu, $level) = @_;
108 my @menuorder = $menu->access_control(\%myconfig, $level);
112 $item = shift @menuorder;
115 $label = $locale->text($label);
117 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
119 if ($menu->{$item}{submenu}) {
121 $display = "display: none;" unless $level eq ' ';
124 <div id="menu$i" class="menuOut" onclick="SwitchMenu('sub$i')" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')">$label</div>
125 <div class="submenu" id="sub$i" style="$display">|;
127 # remove same level items
128 map { shift @menuorder } grep /^$item/, @menuorder;
130 §ion_menu($menu, $item);
139 if ($menu->{$item}{module}) {
141 print qq|<div id="menu$i" class="menuOut" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')"> |.
142 $menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a></div>|;
144 # remove same level items
145 map { shift @menuorder } grep /^$item/, @menuorder;
147 §ion_menu($menu, $item);
151 print qq|<div class="submenu"> |.
152 $menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a></div>|;
157 $display = "display: none;" unless $item eq ' ';
160 <div id="menu$i" class="menuOut" onclick="SwitchMenu('sub$i')" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')">$label</div>
161 <div class="submenu" id="sub$i" style="$display">|;
163 §ion_menu($menu, $item);