automatically generated documentation has to get a session var, too

This commit is contained in:
Colin Kuskie 2006-01-14 00:28:58 +00:00
parent f55e487d3e
commit cc370e180f
3 changed files with 34 additions and 19 deletions

View file

@ -227,21 +227,23 @@ our $HELP = {
body => 'asset list body',
fields => [
],
related => [ map {
my ($namespace) = /::(\w+)$/;
my $tag = $namespace;
$tag =~ s/([a-z])([A-Z])/$1 $2/g; #Separate studly caps
$tag =~ s/([A-Z]+(?![a-z]))/$1 /g; #Separate acronyms
$tag = lc $tag;
$namespace = join '', 'Asset_', $namespace;
{ tag => "$tag add/edit",
namespace => $namespace }
}
grep { $_ } ##Filter out empty entries
@{ $self->session->config->get("assets") },
@{ $self->session->config->get("assetContainers") },
@{ $self->session->config->get("utilityAssets") },
],
related => sub {
my ($session) = @_;
map {
my ($namespace) = /::(\w+)$/;
my $tag = $namespace;
$tag =~ s/([a-z])([A-Z])/$1 $2/g; #Separate studly caps
$tag =~ s/([A-Z]+(?![a-z]))/$1 /g; #Separate acronyms
$tag = lc $tag;
$namespace = join '', 'Asset_', $namespace;
{ tag => "$tag add/edit",
namespace => $namespace }
}
grep { $_ } ##Filter out empty entries
@{ $session->config->get("assets") },
@{ $session->config->get("assetContainers") },
@{ $session->config->get("utilityAssets") },
},
},
};

View file

@ -21,7 +21,8 @@ our $HELP = {
body => 'macros list body',
fields => [
],
related => [
related => sub { ##Hey, you gotta pass in the session var, right?
my $session = shift;
sort { $a->{tag} cmp $b->{tag} }
map {
$tag = $_;
@ -33,8 +34,8 @@ our $HELP = {
{ tag => $tag,
namespace => $namespace }
}
values %{ $self->session->config->get("macros") }
],
values %{ $session->config->get("macros") }
},
},
};