diff options
-rw-r--r-- | server_wizard.pl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/server_wizard.pl b/server_wizard.pl index a0cf2c1d..c6365a59 100644 --- a/server_wizard.pl +++ b/server_wizard.pl @@ -14,14 +14,15 @@ use XML::Parser; use standalone; use interactive; +sub translate { $_[0] } + sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 } sub get_parameter { - my ($tree, $tag) = @_; - my $page; + my ($o, $tree, $tag ,$page) = @_; foreach my $leaf (@$tree) { if (ref($leaf) eq 'ARRAY') { - get_parameter($leaf, $tag); + get_parameter($o, $leaf, $tag, $page); } elsif (ref($leaf) eq 'HASH') { my $common_freetext_chooser; my %actions = (Wizard => sub { @@ -33,7 +34,7 @@ sub get_parameter { }, Page => sub { my $old_page = $page; - $page = { %$leaf }; + push @$o, $page = { %$leaf }; $old_page->{next_page} = $page; }, Target => sub { @@ -98,7 +99,7 @@ sub navigation { if($page->{jumpScript}) { system("source $lib_script ; $page->{jumpScript}"); if ($page->{targetOK} && $page->{targetNOK}) { - find_name($o, $? == 256 ? $page->{targetNOK} : $page->{targetOK}), $page; + find_page($o, $? == 256 ? $page->{targetNOK} : $page->{targetOK}), $page; } else { $page->{next_page}, $page->{old_page}; } @@ -110,7 +111,7 @@ sub navigation { } } -my $o = {}; +my $o = []; get_parameter($o, XML::Parser->new(Style => 'Tree')->parsefile("server.wiz")); $in = 'interactive'->vnew; @@ -121,4 +122,4 @@ $::Wizard_pix_up = "wiz_draknet.png"; $::direct = /-direct/; $::Wizard_no_previous = 1; -navigation($o, $o->[0]{name}); +navigation($o, $o->[0]); |