1 package LJ
::Setting
::MailEncoding
;
2 use base
'LJ::Setting';
6 sub tags
{ qw(mail translate encoding) }
9 my ($class, $u, $errs) = @_;
10 my $key = $class->pkgkey;
11 local $BML::ML_SCOPE
= "/editinfo.bml";
13 LJ
::load_codes
({ "encname" => \
%mail_encnames } );
15 my $ret = "<?h2 $BML::ML{'.translatemailto.header'} h2?>\n";
16 $ret .= LJ
::html_select
({ 'name' => "${key}mailencoding",
17 'selected' => $u->prop('mailencoding')},
18 map { $_, $mail_encnames{$_} } sort keys %mail_encnames);
19 $ret .= "<br />\n$BML::ML{'.translatemailto.about'}";
24 my ($class, $u, $args) = @_;
25 my $val = $args->{'mailencoding'};
28 LJ
::load_codes
({ "encname" => \
%mail_encnames } );
29 $class->errors(oldenc
=> "Invalid") unless ! $val || $mail_encnames{$val};
31 return 1 if $val eq $u->prop('mailencoding');
32 return 0 unless $u->set_prop('mailencoding', $val);