403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/home/SERVERWEB/webmin-2.105/zones/lib/WebminUI/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/home/SERVERWEB/webmin-2.105/zones/lib/WebminUI/OptTextbox.pm
package WebminUI::OptTextbox;
use WebminUI::Textbox;
use WebminCore;
@ISA = ( "WebminUI::Textbox" );

=head2 new WebminUI::OptTextbox(name, value, size, [default-msg], [other-msg])
Create a text field whose value is optional.
=cut
sub new
{
if (defined(&WebminUI::Theme::OptTextbox::new)) {
        return new WebminUI::Theme::OptTextbox(@_[1..$#_]);
        }
my ($self, $name, $value, $size, $default, $other) = @_;
$self = new WebminUI::Textbox($name, $value, $size);
bless($self);
$self->set_default($default || $text{'default'});
$self->set_other($other) if ($other);
return $self;
}

=head2 html()
Returns the HTML for this optional text input
=cut
sub html
{
my ($self) = @_;
return &ui_opt_textbox($self->get_name(), $self->get_value(),
			     $self->{'size'}, $self->{'default'},
			     $self->{'other'});
}

=head2 validate(&inputs)
=cut
sub validate
{
my ($self, $in) = @_;
if (defined($self->get_value())) {
	if ($self->get_value() eq "") {
		return ( $text{'ui_nothing'} );
		}
	return WebminUI::Textbox::validate($self);
	}
return ( );
}

sub set_default
{
my ($self, $default) = @_;
$self->{'default'} = $default;
}

sub set_other
{
my ($self, $other) = @_;
$self->{'other'} = $other;
}

=head2 get_value()
Returns the specified initial value for this field, or the value set when the
form is re-displayed due to an error.
=cut
sub get_value
{
my ($self) = @_;
my $in = $self->{'form'} ? $self->{'form'}->{'in'} : undef;
if ($in && (defined($in->{$self->{'name'}}) ||
	    defined($in->{$self->{'name'}.'_def'}))) {
	return $in->{$self->{'name'}.'_def'} ? undef : $in->{$self->{'name'}};
	}
elsif ($in && defined($in->{"ui_value_".$self->{'name'}})) {
	return $in->{"ui_value_".$self->{'name'}};
	}
else {
	return $self->{'value'};
	}
}

=head2 get_input_names()
Returns the actual names of all HTML elements that make up this input
=cut
sub get_input_names
{
my ($self) = @_;
return ( $self->{'name'}, $self->{'name'}."_def[0]",
			  $self->{'name'}."_def[1]" );
}

1;


Youez - 2016 - github.com/yon3zu
LinuXploit