From 50be11c3574706cae5e219ba910e8221e50da4e8 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 27 Jun 2007 15:19:55 +0000 Subject: Moving menu.pl to old-handler.pl and adjusting top level scripts accordingly. Including also an unfinished and inactive version of the menu system running under the new architecture. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1334 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Menu.pm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/Menu.pm b/LedgerSMB/Menu.pm index 30aa28c6..5c017a7c 100644 --- a/LedgerSMB/Menu.pm +++ b/LedgerSMB/Menu.pm @@ -48,19 +48,18 @@ sub new { my $orig_key = $key; my $ref = $self; while ($key =~ s/^([^-]*)--//){ - if (!defined $ref->{$1}){ - $ref->{$1} = {}; - } - if (!defined $ref->{$1}->{subs}){ - $ref->{$1}->{subs} = {}; - } - $ref = $ref->{$1}->{subs}; + $ref->{subs} ||= {}; + $ref->{subs}->{$1} ||= {}; + $ref = $ref->{subs}->{$1}; } - for (keys %{$config->{$orig_key}}){ - $ref->{$_} = $config{$orig_key}->{$_}; + $ref->{subs} ||= {}; + $ref->{subs}->{key} ||= {}; + $ref = $ref->{subs}->{$key}; + for (keys %{$config{$orig_key}}){ + $ref->{$_} = ${$config{$orig_key}}{$_}; } - $ref->{$key}{id} = $index; - $ref->{$key}{label} = $key; + $ref->{id} = $index; + $ref->{label} = $key; ++$index; } } -- cgit v1.2.3