Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a7393349

Von Sven Schöling vor mehr als 9 Jahren hinzugefügt

  • ID a73933498683c517e84d5a6befe1566b9c9409d9
  • Vorgänger 31d8e1a0
  • Nachfolger 70242f1e

Menu: Bei einzelner erp.ini nicht alles umkopieren.

Unterschiede anzeigen:

SL/Menu.pm
34 34

  
35 35
package Menu;
36 36

  
37
use strict;
38

  
37 39
use SL::Auth;
38 40
use SL::Inifile;
39 41

  
40
use strict;
42
our @ISA = qw(Inifile);
43

  
41 44

  
42 45
sub new {
43 46
  $main::lxdebug->enter_sub();
44 47

  
45
  my ($type, @menufiles) = @_;
46
  my $self               = bless {}, $type;
47

  
48
  my @order;
48
  my ($package, @menufiles) = @_;
49 49

  
50
  foreach my $menufile (grep { -f } @menufiles) {
51
    my $inifile = Inifile->new($menufile);
50
  my $self = $package->SUPER::new($menufiles[0]);
52 51

  
53
    push @order, @{ delete($inifile->{ORDER}) || [] };
54
    $self->{$_} = $inifile->{$_} for keys %{ $inifile };
52
  for (@menufiles[1..$#menufiles]) {
53
    my $inifile = Inifile->new($_);
54
    push @{ $self->{ORDER} }, @{ delete $inifile->{ORDER} };
55
    $self->{$_} = $inifile->{$_} for keys %$inifile;
55 56
  }
56 57

  
57
  $self->{ORDER} = \@order;
58

  
59
  $self->set_access();
58
  $self->set_access;
60 59

  
61 60
  $main::lxdebug->leave_sub();
62 61

  
......
68 67

  
69 68
  my ($self, $name, $item) = @_;
70 69

  
71
  my $form        =  $main::form;
72
  my $myconfig    = \%main::myconfig;
73

  
74
  my $module      = $self->{$name}->{module} || $form->{script};
70
  my $module      = $self->{$name}->{module} || $::form->{script};
75 71
  my $action      = $self->{$name}->{action};
76 72

  
77 73
  $item->{target} = $self->{$name}->{target} || "main_window";
78
  $item->{href}   = $self->{$name}->{href}   || "${module}?action=" . $form->escape($action);
74
  $item->{href}   = $self->{$name}->{href}   || "${module}?action=" . $::form->escape($action);
79 75

  
80 76
  my @vars = qw(module target href);
81 77
  push @vars, 'action' unless ($self->{$name}->{href});
......
85 81
  # add other params
86 82
  foreach my $key (keys %{ $self->{$name} }) {
87 83
    my ($value, $conf)  = split(m/=/, $self->{$name}->{$key}, 2);
88
    $value              = $myconfig->{$value} . "/$conf" if ($conf);
89
    $item->{href}      .= "&" . $form->escape($key) . "=" . $form->escape($value);
84
    $value              = $::myconfig->{$value} . "/$conf" if ($conf);
85
    $item->{href}      .= "&" . $::form->escape($key) . "=" . $::form->escape($value);
90 86
  }
91 87

  
92 88
  $main::lxdebug->leave_sub(LXDebug::DEBUG2());

Auch abrufbar als: Unified diff