Begin the Help purge.

First batch.  Autogenerated lists of Assets, Workflow Activities and Template
Parsers. Enabled Macros stay, but no linking to Macro pages.
This commit is contained in:
Colin Kuskie 2007-07-16 22:39:46 +00:00
parent 02abc68aa8
commit 14180620ca
5 changed files with 10 additions and 180 deletions

View file

@ -504,30 +504,6 @@ our $HELP = {
]
},
'asset list' => {
title => 'asset list title',
body => 'asset list body',
fields => [
],
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") },
},
},
};
1;

View file

@ -155,68 +155,6 @@ our $HELP = {
]
},
'template parsers list' => {
title => 'template parsers list title',
body => sub {
my $session = shift;
my $dir = join '/', $session->config->getWebguiRoot,"lib","WebGUI","Asset","Template";
opendir (DIR,$dir) or $session->errorHandler->fatal("Can't open Macro directory: $dir!");
my @plugins = map { s/\.pm//; $_; }
grep { $_ ne "Parser.pm" }
grep { /\.pm$/ }
readdir(DIR); ##list of namespaces
closedir(DIR);
##Build list of enabled macros, by namespace, by reversing session hash:
my @enabledPlugins = map { m/^WebGUI::Asset::Template::(\S+)/; $1 } @{ $session->config->get("templateParsers") };
my $defaultParser = $session->config->get('defaultTemplateParser');
$defaultParser =~ s/^WebGUI::Asset::Template:://;
my %enabledPlugins = map { $_ => 1 } @enabledPlugins;
my $i18n = WebGUI::International->new($session, 'Asset_Template');
my $yes = $i18n->get(138, 'WebGUI');
my $no = $i18n->get(139, 'WebGUI');
my $plugin_table =
join "\n",
map { join '', '<tr><td>', $_,
'</td><td>',
($enabledPlugins{$_} ? $yes : $no),
'</td><td>',
($_ eq $defaultParser ? $yes : $no),
'</td>',
} @plugins;
$plugin_table =
join("\n",
$i18n->get('template parsers list body'),
'<table border="1" cellpadding="3">',
'<tr><th>',$i18n->get('plugin name'),
'</th><th>',
$i18n->get('plugin enabled header'),
'</th><th>',
$i18n->get('default parser'),
'</th></tr>',$plugin_table,'</table>');
},
fields => [],
related => sub { ##Hey, you gotta pass in the session var, right?
my $session = shift;
sort { $a->{tag} cmp $b->{tag} }
map {
s/^WebGUI::Asset::Template:://;
$tag = $_;
$tag =~ s/^[a-zA-Z]+_//; #Remove initial shortcuts
$tag =~ s/([A-Z]+(?![a-z]))/$1 /g; #Separate acronyms
$tag =~ s/([a-z])([A-Z])/$1 $2/g; #Separate studly caps
$tag =~ s/\s+$//;
$tag = lc $tag;
$namespace = join '', 'Template_', $_;
{ tag => $tag,
namespace => $namespace }
}
@{ $session->config->get("templateParsers") }
},
,
},
};
1;

View file

@ -11,10 +11,6 @@ our $HELP = {
tag => 'macros using',
namespace => 'Macros'
},
{
tag => 'macros list',
namespace => 'Macros'
},
{
tag => 'random asset proxy',
namespace => 'Macro_RandomAssetProxy'

View file

@ -3,20 +3,20 @@ package WebGUI::Help::Macros;
our $HELP = {
'macros using' => {
'macros using' => {
title => 'macros using title',
body => 'macros using body',
fields => [
],
related => [
{
tag => "macros list",
namespace => "Macros",
},
],
},
{
tag => "macros list",
namespace => "Macros",
},
],
},
'macros list' => {
'macros list' => {
title => 'macros list title',
body => sub {
my $session = shift;
@ -55,23 +55,8 @@ our $HELP = {
'</th></tr>',$macro_table,'</table>');
},
fields => [],
related => sub { ##Hey, you gotta pass in the session var, right?
my $session = shift;
sort { $a->{tag} cmp $b->{tag} }
map {
$tag = $_;
$tag =~ s/^[a-zA-Z]+_//; #Remove initial shortcuts
$tag =~ s/([A-Z]+(?![a-z]))/$1 /g; #Separate acronyms
$tag =~ s/([a-z])([A-Z])/$1 $2/g; #Separate studly caps
$tag =~ s/\s+$//;
$tag = lc $tag;
$namespace = join '', 'Macro_', $_;
{ tag => $tag,
namespace => $namespace }
}
values %{ $session->config->get("macros") }
},
},
related => [],
},
};

View file

@ -24,71 +24,6 @@ our $HELP = {
],
},
'list of installed activities' => {
title => 'list of installed activities',
body => sub {
my $session = shift;
my $dir = join '/', $session->config->getWebguiRoot,"lib","WebGUI","Workflow","Activity";
opendir (DIR,$dir) or $session->errorHandler->fatal("Can't open Activity directory: $dir!");
my @installedActivities = sort map { s/\.pm//; $_; }
grep { /\.pm$/ }
readdir(DIR); ##list of namespaces
closedir(DIR);
##Build list of enabled activities, by namespace, by reversing session hash:
my %workflows = %{ $session->config->get("workflowActivities") };
my %activities = map { s/^WebGUI::Workflow::Activity:://; $_ => 1 }
map { @{ $workflows{$_} } }
keys %workflows;
my $i18n = WebGUI::International->new($session, 'Workflow_Activity');
my $yes = $i18n->get(138, 'WebGUI');
my $no = $i18n->get(139, 'WebGUI');
my $activity_table =
join "\n",
map { join '', '<tr><td>', $_,
'</td><td>',
($activities{$_} ? $yes : $no),
'</td></tr>'
} @installedActivities;
$activity_table =
join("\n",
$i18n->get('activities list body'),
'<table border="1" cellpadding="3">',
'<tr><th>',$i18n->get('activity name'),
'</th><th>',
$i18n->get('activity enabled header'),
'</th></tr>',$activity_table,'</table>');
},
isa => [
],
fields => [
],
variables => [
],
related => sub {
my $session = shift;
##Build list of enabled activities, by namespace, by reversing session hash:
my %workflows = %{ $session->config->get("workflowActivities") };
my @activities = map { s/^WebGUI::Workflow::Activity:://; $_; }
map { @{ $workflows{$_} } }
keys %workflows;
return map {
my ($namespace, $tag) = ($_, $_);
$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 '', 'Workflow_Activity_', $namespace;
#$session->errorHandler->warn($tag.' '.$namespace);
{ tag => "$tag",
namespace => $namespace }
} @activities;
},
},
};
1; ##All perl modules must return true