# This code was forked from the LiveJournal project owned and operated
# by Live Journal, Inc. The code has been modified and expanded by
# Dreamwidth Studios, LLC. These files were originally licensed under
# the terms of the license supplied by Live Journal, Inc, which can
# currently be found at:
#
# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
#
# In accordance with the original license, this code and all its
# modifications are provided under the GNU General Public License.
# A copy of that license can be found in the LICENSE file included as
# part of this distribution.
package LJ::Setting::FindByEmail;
use base 'LJ::Setting';
use strict;
use warnings;
sub helpurl {
my ( $class, $u ) = @_;
return "find_by_email";
}
*option = \&as_html;
sub as_html {
my ( $class, $u, $errs, $args ) = @_;
my $key = $class->pkgkey;
my $ret;
my $helper = ( $args && $args->{helper} == 0 ) ? 0 : 1;
my $faq = ( $args && $args->{faq} == 1 ) ? 1 : 0;
$ret .=
""
unless $args && $args->{minimal_display};
# Display learn more link?
$ret .=
" ("
. $class->ml('settings.settingprod.learn')
. ")
"
if ( $faq && $LJ::HELPURL{ $class->helpurl($u) } );
$ret .= "
" unless $args && $args->{minimal_display};
my @options;
push @options, { text => $class->ml('settings.option.select'), value => '' }
unless $u->opt_findbyemail;
push @options, { text => LJ::Lang::ml('settings.findbyemail.opt.Y'), value => "Y" };
push @options, { text => LJ::Lang::ml('settings.findbyemail.opt.H'), value => "H" };
push @options, { text => LJ::Lang::ml('settings.findbyemail.opt.N'), value => "N" };
$ret .= LJ::html_select(
{
'name' => "${key}opt_findbyemail",
'id' => "${key}opt_findbyemail",
'class' => "select",
'selected' => $u->opt_findbyemail || ''
},
@options
);
# Display helper text about setting?
$ret .= "