[loop list="[list-databases]"]
[loop-sub db_action]
sub {
#Log("args=" . $Tag->uneval({ ref => \@_ }));
my $name = shift;
return if $admin{$name};
my $rec = shift;
my $tab = $rec->[0];
if(! $admin_done++) {
# Set up hidden tables
%admin = map { ($_, 1) } split /[\s.\0]+/, $Variable->{UI_ADMIN_TABLES};
# To build the links to hidden tables
$Scratch->{ui_tmp_admin} = join " ", sort keys %admin;
}
return '' if $admin{$tab};
#Log("name=$name tab=$tab");
$name = $tab if ! $name;
my $url = "$Config->{VendURL}/__UI_BASE__";
my $froot = sub {
my $fn = shift;
$fn =~ s#^$Config->{VendRoot}/##o;
return $fn;
};
my $ref = {
upload => {
img => 'up.gif',
url => $Tag->area(
'__UI_BASE__/upload_file',
$froot->(join "/",
($Config->{Database}{$tab}{dir} || $Config->{ProductDir}),
$Config->{Database}{$tab}{file}
),
{
form => 'ui_return_to=@@MV_PAGE@@'
}
),
},
download => {
img => 'down.gif',
url => $Tag->area(
{
href => 'ui_download/' .
$froot->(
join "/",
( $Config->{Database}{$tab}{dir}
||
$Config->{ProductDir}
),
$Config->{Database}{$tab}{file}
),
form => 'filler=1',
},
),
},
import => {
img => 'left.gif',
url => $Tag->area(
{
href => '__UI_BASE__/import_table',
form => "mv_data_table=$tab",
}
),
},
export => {
img => 'right.gif',
url => $Tag->area(
{
href => '__UI_BASE__/export_table',
form => "mv_data_table=$tab",
}
),
},
config => {
img => 'icon_config.gif',
url => $Tag->area(
{
href => '__UI_BASE__/dbconfig',
form => "mv_data_table=$tab",
}
),
},
edit => {
img => 'layout.gif',
url => $Tag->area(
{
href => '__UI_BASE__/flex_select',
form => "mv_data_table=$tab",
}
),
},
};
my $out = '';
my @litems;
if($Variable->{UI_DBCONFIG}) {
@litems = (
'[L]edit[/L]',
'[L]import[/L]',
'[L]export[/L]',
'[L]upload[/L]',
'[L]download[/L]',
'[L]config[/L]',
'[L]Table name[/L] ([L]description[/L])',
);
}
else {
@litems = (
'[L]edit[/L]',
'[L]import[/L]',
'[L]export[/L]',
'[L]upload[/L]',
'[L]download[/L]',
'[L]Table name[/L] ([L]description[/L])',
);
}
if(! $dblist_done_one++) {
$out .= '';
for(@litems) { # Add "report"
$out .= qq{$_ | };
}
$out .= " ";
}
$out .= '';
my @mitems = (qw/edit import export upload download/);
if($Variable->{UI_DBCONFIG}) {
push @mitems, 'config';
}
for(@mitems) { # Add "report"
my $line = $ref->{$_};
$out .= <
EOF
}
$out .= qq{ $name};
my $desc = tag_data('__UI_META_TABLE__', 'name', $name);
$out .= qq{ ($desc)} if $desc;
$out .= q{ | };
return $out;
}
[/loop-sub]
[loop-exec db_action][loop-data __UI_META_TABLE__ label][/loop-exec]
[/loop]
|