Dynamically generate a table showing all installed activities, and show

which ones are enbled in the site's WebGUI.conf.  Reword the same table
in the Macros file.
This commit is contained in:
Colin Kuskie 2006-07-02 17:53:20 +00:00
parent 3b5f69c8c7
commit 8515db2311
3 changed files with 87 additions and 3 deletions

View file

@ -24,6 +24,53 @@ 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 => [
],
},
};
1; ##All perl modules must return true

View file

@ -24,8 +24,15 @@ our $I18N = {
},
'macros list body' => {
message => q|<p>The set of available Macros is defined in the WebGUI configuration file. The table below shows all macros that are available for use on your site, and which ones have
been enabled on your use. If the macro is enabled, the table will list the shortcut that is used to call it.</p>
message => q|<p>Making a macro available for use on your site is a two step process.</p>
<div>
<ol>
<li>The macro must be put in the Macros directory in the WebGUI source code: lib/WebGUI/Macros/.</li>
<li>The macro must be enabled in your WebGUI.conf file, in the "macros" section. In that section, you can assign a shortcut that is different from the macro's name.</li>
</ol>
</div>
<p>The table below shows which macros are installed on your site and which have been configured in your WebGUI.conf file.</p>
|,
context => 'Content for dynamically generated macro list',
lastUpdated => 1150994876,

View file

@ -37,8 +37,38 @@ our $I18N = {
lastUpdated => 0,
},
'list of installed activities' => {
message => q|List of Installed Workflow Activities|,
lastUpdated => 0,
},
'activities list body' => {
message => q|<p>Making a Workflow Activity available for use on your site is a two step process.</p>
<div>
<ol>
<li>The activity must be put in the Activities directory in the WebGUI source code: lib/WebGUI/Workflow/Activities.</li>
<li>The activity must be enabled in your WebGUI.conf file, in the "workflowActivities" section.</li>
</ol>
</div>
<p>The table below shows which activities are installed on your site and which have been configured in your WebGUI.conf file. It does not say if the activity is used in a Workflow.</p>
|,
lastUpdated => 0,
},
'activity enabled header' => {
message => q|Activity Enabled?|,
lastUpdated => 1112591289,
context => q|Table heading in List of Activities help page. Short for "Is this Activity enabled?"|,
},
'activity name' => {
message => q|Activity Name|,
lastUpdated => 1112591289,
context => q|Table heading in List of Activities help page. Short for "Is this Activity enabled?"|,
},
'topicName' => {
message => q|Base Workflow Activity|,
message => q|Workflow Activities|,
context => q|The name of this workflow activity.|,
lastUpdated => 0,
},