1 package LJ
::Setting
::SelfCommentEmail
;
2 use base
'LJ::Setting';
9 return $u && !$u->is_community ?
1 : 0;
15 return $u->get_cap("getselfemail") ?
0 : 1;
21 return $u->prop("opt_getselfemail") && !$class->disabled($u) ?
1 : 0;
27 return $class->ml('setting.selfcommentemail.label');
31 my ($class, $u, $errs, $args, %opts) = @_;
33 return $class->htmlcontrol($u, $errs, $args, %opts) . " " . $class->htmlcontrol_label($u);
36 sub htmlcontrol_label
{
38 my $key = $class->pkgkey;
40 return "<label for='${key}selfcommentemail'>" . $class->ml('setting.selfcommentemail.option') . "</label>";
44 my ($class, $u, $errs, $args, %opts) = @_;
45 my $key = $class->pkgkey;
48 my $catid = $opts{notif_catid
};
49 my $ntypeid = $opts{notif_ntypeid
};
51 return LJ
::html_check
({
52 class => "SubscribeCheckbox-$catid-$ntypeid",
57 return LJ
::html_check
({
58 name
=> "${key}selfcommentemail",
59 id
=> "${key}selfcommentemail",
60 class => "SubscriptionInboxCheck",
62 selected
=> $class->selected($u) ?
1 : 0,
63 disabled
=> $class->disabled($u) ?
1 : 0,
69 my ($class, $u, $args) = @_;
71 my $val = $class->get_arg($args, "selfcommentemail") ?
1 : 0;
72 $u->set_prop( opt_getselfemail
=> $val );