diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-30 06:43:48 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-30 06:43:48 +0000 |
commit | f6f049eb28180b2e51f8dac70ef345ce889c847f (patch) | |
tree | cd9908734bfe4677120b31f9a12b8ba3a603da81 /LedgerSMB/Menu.pm | |
parent | 32aef327a1e3b769c0c08c6b1786daaa841e017b (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-x | LedgerSMB/Menu.pm | 102 |
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}&action=$action&level=$level&login=$form->{login}&timeout=$form->{timeout}&sessionid=$form->{sessionid}&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}&action=$action&|. + qq|level=$level&login=$form->{login}&|. + qq|timeout=$form->{timeout}&sessionid=$form->{sessionid}|. + qq|&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 .= "&".$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 .= "&".$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; } |