mirror of
https://github.com/webmin/webmin.git
synced 2025-07-23 00:30:33 +00:00
30 lines
575 B
Perl
Executable File
30 lines
575 B
Perl
Executable File
|
|
require './mysql-lib.pl';
|
|
|
|
sub show_charset
|
|
{
|
|
local ($value) = @_;
|
|
local $main::error_must_die = 1;
|
|
local @charsets;
|
|
eval { @charsets = &list_character_sets(); };
|
|
if (@charsets) {
|
|
@charsets = sort { $a->[1] cmp $b->[1] } @charsets;
|
|
return &ui_select("charset", $value,
|
|
[ [ "", "<$text{'default'}>" ], @charsets ]);
|
|
}
|
|
else {
|
|
return &ui_opt_textbox("charset", $value, 20, $text{'default'});
|
|
}
|
|
}
|
|
|
|
sub parse_charset
|
|
{
|
|
if ($in{'charset_def'}) {
|
|
return undef;
|
|
}
|
|
else {
|
|
$in{'charset'} =~ /^\S*$/ || &error($text{'config_echarset'});
|
|
return $in{'charset'};
|
|
}
|
|
}
|