1 package LJ
::Setting
::UserMessaging
;
2 use base
'LJ::Setting';
6 sub tags
{ qw(email message contact) }
9 my ($class, $u, $errs, $args) = @_;
10 my $key = $class->pkgkey;
13 $ret .= "<label for='${key}opt_usermsg'>" . $class->ml('settings.usermessaging.question') . "</label>";
14 $ret .= LJ
::html_select
({ 'name' => "${key}opt_usermsg",
15 'id' => "${key}opt_usermsg",
17 'selected' => $u->opt_usermsg },
18 { text
=> LJ
::Lang
::ml
('settings.usermessaging.opt.Y'),
20 disabled
=> $u->is_child,},
21 { text
=> LJ
::Lang
::ml
('settings.usermessaging.opt.F'),
23 disabled
=> $u->is_child,},
24 ($LJ::DISABLED
{'new_friends_and_subscriptions'} ?
25 { text
=> LJ
::Lang
::ml
('settings.usermessaging.opt.M'),
27 { text
=> LJ
::Lang
::ml
('settings.usermessaging.opt.N'),
29 $ret .= "<div class='helper'>" .
30 $class->ml('settings.usermessaging.helper', {
31 sitename
=> $LJ::SITENAMESHORT
}) .
33 $ret .= $class->errdiv($errs, "opt_usermsg");
39 my ($class, $u, $args) = @_;
40 my $opt_usermsg= $class->get_arg($args, "opt_usermsg");
41 $class->errors("opt_usermsg" => $class->ml('settings.usermessaging.error.invalid')) unless $opt_usermsg=~ /^[MFNY]$/;
46 my ($class, $u, $args) = @_;
47 $class->error_check($u, $args);
49 my $opt_usermsg = $class->get_arg($args, "opt_usermsg");
50 return $u->set_prop('opt_usermsg', $opt_usermsg);