1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 #=====================================================================
8 # SQL-Ledger Accounting
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
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 # routines for menu items
33 #=====================================================================
38 $main::lxdebug->enter_sub();
40 my ($type, $menufile, $level) = @_;
43 my $self = Inifile->new($menufile, $level);
45 $main::lxdebug->leave_sub();
51 $main::lxdebug->enter_sub();
53 my ($self, $myconfig, $form, $item) = @_;
55 my $module = $form->{script};
56 my $action = "section_menu";
59 if ($self->{$item}{module}) {
60 $module = $self->{$item}{module};
62 if ($self->{$item}{action}) {
63 $action = $self->{$item}{action};
65 if ($self->{$item}{target}) {
66 $target = $self->{$item}{target};
69 my $level = $form->escape($item);
71 qq|<a href=$module?path=$form->{path}&action=$action&level=$level&login=$form->{login}&password=$form->{password}|;
72 my @vars = qw(module action target href);
74 if ($self->{$item}{href}) {
75 $str = qq|<a href=$self->{$item}{href}|;
76 @vars = qw(module target href);
79 map { delete $self->{$item}{$_} } @vars;
82 foreach my $key (keys %{ $self->{$item} }) {
83 $str .= "&" . $form->escape($key, 1) . "=";
84 ($value, $conf) = split /=/, $self->{$item}{$key}, 2;
85 $value = $myconfig->{$value} . "/$conf" if ($conf);
86 $str .= $form->escape($value, 1);
90 $str .= qq| target=$target|;
95 $main::lxdebug->leave_sub();
101 $main::lxdebug->enter_sub();
103 my ($self, $myconfig, $menulevel) = @_;
107 if ($menulevel eq "") {
108 @menu = grep { !/--/ } @{ $self->{ORDER} };
110 @menu = grep { /^${menulevel}--/ } @{ $self->{ORDER} };
113 my @a = split /;/, $myconfig->{acs};
116 # remove --AR, --AP from array
117 grep { ($a, $b) = split /--/; s/--$a$//; } @a;
119 map { $excl{$_} = 1 } @a;
122 map { push @a, $_ unless $excl{$_} } (@menu);
124 $main::lxdebug->leave_sub();