make the dynamic list of macros work again
This commit is contained in:
parent
5f93f2dc13
commit
dbab69eb2f
4 changed files with 35 additions and 46 deletions
|
|
@ -1,41 +0,0 @@
|
|||
package WebGUI::i18n::English::Automated_Information;
|
||||
|
||||
##This module must not be preloaded, since it requires that $session
|
||||
##be populated when the module is use'ed.
|
||||
|
||||
use WebGUI::International;
|
||||
my $i18n = WebGUI::International->new($session, 'Macros');
|
||||
|
||||
##Get list of all macros by namespace/module name
|
||||
my $dir = join '/', $self->session->config->getWebguiRoot,"lib","WebGUI","Macro";
|
||||
opendir (DIR,$dir) or $self->session->errorHandler->fatal("Can't open Macro directory: $dir!");
|
||||
my @macros = map { s/Macro_//; s/\.pm//; $_; }
|
||||
grep { /\.pm$/ }
|
||||
readdir(DIR); ##list of namespaces
|
||||
closedir(DIR);
|
||||
|
||||
##Build list of enabled macros, by namespace by reversing session hash:
|
||||
my %macros = reverse %{ $self->session->config->get("macros") };
|
||||
|
||||
my $macro_table =
|
||||
join "\n",
|
||||
map { join '', '<tr><td>', $_, '</td><td>',
|
||||
($macros{$_} ? ('^', $macros{$_}, '();') : ' '),
|
||||
'</td></tr>' }
|
||||
@macros;
|
||||
|
||||
$macro_table =
|
||||
join("\n",
|
||||
'<table border="1" cellpadding="3">',
|
||||
'<tr><th>',$i18n->get('macro name'),
|
||||
'</th><th>',
|
||||
$i18n->get('macro shortcut'),
|
||||
'</th></tr>',$macro_table,'</table>');
|
||||
|
||||
our $I18N = {
|
||||
'macro table' => {
|
||||
message => $macro_table,
|
||||
lastUpdated => 1112466408,
|
||||
}
|
||||
};
|
||||
1;
|
||||
|
|
@ -19,7 +19,6 @@ our $I18N = {
|
|||
|
||||
'macros list body' => {
|
||||
message => q|<p>The set of available Macros is defined in the WebGUI configuration file. These Macros are available for use on your site:</p>
|
||||
^International("macro table","Automated_Information");
|
||||
|,
|
||||
context => 'Content for dynamically generated macro list',
|
||||
lastUpdated => 1114134745,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue