summaryrefslogtreecommitdiff
path: root/LedgerSMB/Menu.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-30 06:43:48 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-30 06:43:48 +0000
commitf6f049eb28180b2e51f8dac70ef345ce889c847f (patch)
treecd9908734bfe4677120b31f9a12b8ba3a603da81 /LedgerSMB/Menu.pm
parent32aef327a1e3b769c0c08c6b1786daaa841e017b (diff)
Whitepace cleanup on Menu, Mailer, Inifile, and Num2text
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@173 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Menu.pm')
-rwxr-xr-xLedgerSMB/Menu.pm102
1 files changed, 55 insertions, 47 deletions
diff --git a/LedgerSMB/Menu.pm b/LedgerSMB/Menu.pm
index f61db708..344bb7d7 100755
--- a/LedgerSMB/Menu.pm
+++ b/LedgerSMB/Menu.pm
@@ -23,7 +23,7 @@
#
#======================================================================
#
-# This file has NOT undergone whitespace cleanup.
+# This file has undergone whitespace cleanup.
#
#======================================================================
#
@@ -38,72 +38,80 @@ use LedgerSMB::Inifile;
sub menuitem {
- my ($self, $myconfig, $form, $item) = @_;
-
- my $module = ($self->{$item}{module}) ? $self->{$item}{module} : $form->{script};
- my $action = ($self->{$item}{action}) ? $self->{$item}{action} : "section_menu";
- my $target = ($self->{$item}{target}) ? $self->{$item}{target} : "";
-
- my $level = $form->escape($item);
- my $str = qq|<a style="display:block;" href="$module?path=$form->{path}&amp;action=$action&amp;level=$level&amp;login=$form->{login}&amp;timeout=$form->{timeout}&amp;sessionid=$form->{sessionid}&amp;js=$form->{js}|;
-
- my @vars = qw(module action target href);
+ my ($self, $myconfig, $form, $item) = @_;
+
+ my $module = ($self->{$item}{module})
+ ? $self->{$item}{module} : $form->{script};
+ my $action = ($self->{$item}{action})
+ ? $self->{$item}{action} : "section_menu";
+ my $target = ($self->{$item}{target})
+ ? $self->{$item}{target} : "";
+
+ my $level = $form->escape($item);
+ my $str = qq|<a style="display:block;"|.
+ qq|href="$module?path=$form->{path}&amp;action=$action&amp;|.
+ qq|level=$level&amp;login=$form->{login}&amp;|.
+ qq|timeout=$form->{timeout}&amp;sessionid=$form->{sessionid}|.
+ qq|&amp;js=$form->{js}|;
+
+ my @vars = qw(module action target href);
- if ($self->{$item}{href}) {
- $str = qq|<a href="$self->{$item}{href}|;
- @vars = qw(module target href);
- }
+ if ($self->{$item}{href}) {
+ $str = qq|<a href="$self->{$item}{href}|;
+ @vars = qw(module target href);
+ }
- for (@vars) { delete $self->{$item}{$_} }
+ for (@vars) { delete $self->{$item}{$_} }
- delete $self->{$item}{submenu};
+ delete $self->{$item}{submenu};
- # add other params
- foreach my $key (keys %{ $self->{$item} }) {
- $str .= "&amp;".$form->escape($key)."=";
- ($value, $conf) = split /=/, $self->{$item}{$key}, 2;
- $value = "$myconfig->{$value}$conf" if $self->{$item}{$key} =~ /=/;
+ # add other params
+ foreach my $key (keys %{ $self->{$item} }) {
+ $str .= "&amp;".$form->escape($key)."=";
+ ($value, $conf) = split /=/, $self->{$item}{$key}, 2;
+ $value = "$myconfig->{$value}$conf"
+ if $self->{$item}{$key} =~ /=/;
- $str .= $form->escape($value);
- }
+ $str .= $form->escape($value);
+ }
- $str .= qq|#id$form->{tag}| if $target eq 'acc_menu';
+ $str .= qq|#id$form->{tag}| if $target eq 'acc_menu';
- if ($target) {
- $str .= qq|" target="$target"|;
- }
- else{
- $str .= '"';
- }
+ if ($target) {
+ $str .= qq|" target="$target"|;
+ }
+ else{
+ $str .= '"';
+ }
- $str .= qq|>|;
+ $str .= qq|>|;
}
sub access_control {
- my ($self, $myconfig, $menulevel) = @_;
+ my ($self, $myconfig, $menulevel) = @_;
- my @menu = ();
+ my @menu = ();
- if ($menulevel eq "") {
- @menu = grep { !/--/ } @{ $self->{ORDER} };
- } else {
- @menu = grep { /^${menulevel}--/; } @{ $self->{ORDER} };
- }
+ if ($menulevel eq "") {
+ @menu = grep { !/--/ } @{ $self->{ORDER} };
+ } else {
+ @menu = grep { /^${menulevel}--/; } @{ $self->{ORDER} };
+ }
- my @a = split /;/, $myconfig->{acs};
- my $excl = ();
+ my @a = split /;/, $myconfig->{acs};
+ my $excl = ();
- # remove --AR, --AP from array
- grep { ($a, $b) = split /--/; s/--$a$//; } @a;
+ # remove --AR, --AP from array
+ grep { ($a, $b) = split /--/; s/--$a$//; } @a;
- for (@a) { $excl{$_} = 1 }
+ for (@a) { $excl{$_} = 1 }
- @a = ();
- for (@menu) { push @a, $_ unless $excl{$_} }
+ @a = ();
+ for (@menu) { push @a, $_ unless $excl{$_} }
- @a;
+ @a;
}