This commit is contained in:
JT Smith 2006-05-30 14:04:26 +00:00
parent c96cef545c
commit c23e29cdd7

View file

@ -44,27 +44,27 @@ sub _load {
my $cmd = "WebGUI::Help::".$namespace; my $cmd = "WebGUI::Help::".$namespace;
my $load = sprintf 'use %-s; $%-s::HELP;', $cmd, $cmd; my $load = sprintf 'use %-s; $%-s::HELP;', $cmd, $cmd;
my $hash = eval($load); my $hash = eval($load);
my %help = %{$hash};
unless ($@) { unless ($@) {
foreach my $tag (keys %{$hash}) { foreach my $tag (keys %help) {
if ($hash->{$tag}{isa}{namespace}) { if ($help{$tag}{isa}{namespace}) {
my $other = _load($session, $hash->{$tag}{isa}{namespace}); my $other = _load($session, $help{$tag}{isa}{namespace});
my $add = $other->{$hash->{$tag}{isa}{tag}}{fields}; my $add = $other->{$help{$tag}{isa}{tag}}{fields};
@{$hash->{$tag}{fields}} = (@{$hash->{$tag}{fields}}, @{$add}); @{$help{$tag}{fields}} = (@{$help{$tag}{fields}}, @{$add});
$add = $other->{$hash->{$tag}{isa}{tag}}{related}; $add = $other->{$help{$tag}{isa}{tag}}{related};
@{$hash->{$tag}{related}} = (@{$hash->{$tag}{related}}, @{$add}); @{$help{$tag}{related}} = (@{$help{$tag}{related}}, @{$add});
$add = $other->{$hash->{$tag}{isa}{tag}}{variables}; $add = $other->{$help{$tag}{isa}{tag}}{variables};
foreach my $row (@{$add}) { foreach my $row (@{$add}) {
push(@{$hash->{$tag}{variables}}, { push(@{$help{$tag}{variables}}, {
name=> $row->{name}, name=> $row->{name},
description => $row->{description}, description => $row->{description},
namespace => $row->{namespace} || $hash->{$tag}{isa}{namespace} namespace => $row->{namespace} || $help{$tag}{isa}{namespace}
}); });
} }
} }
} }
return $hash return \%help;
} } else {
else {
$session->errorHandler->error("Help failed to compile: $namespace. ".$@); $session->errorHandler->error("Help failed to compile: $namespace. ".$@);
return {}; return {};
} }