LON-CAPA Localization Project
Language: $FORM{'lang'}
List all
ENDSCREEN
$FORM{'lang'}=~s/\W//g;
if ($FORM{'trans'}) {
if (tie(%hash,'GDBM_File',
'/home/httpd/perl/logs/'.$FORM{'lang'}.'.db',&GDBM_WRCREAT(),0640)) {
$hash{$FORM{'arg1'}}=$FORM{'trans'};
untie %hash;
print "Stored.";
}
} elsif ($FORM{'list'}) {
if (tie(%hash,'GDBM_File',
'/home/httpd/perl/logs/'.$FORM{'lang'}.'.db',&GDBM_READER(),0640)) {
print "";
foreach (sort keys %hash) {
print "\n '".$_."'".
"\n=> '".$hash{$_}."',\n";
}
print "
";
untie %hash;
}
} else {
my $trans=$FORM{'arg1'};
if (tie(%hash,'GDBM_File',
'/home/httpd/perl/logs/'.$FORM{'lang'}.'.db',&GDBM_READER(),0640)) {
if ($hash{$trans}) { $trans=$hash{$trans}; }
untie %hash;
}
print (<$FORM{'arg1'}
ENDQUERY
}
print('