MOON
Server: Apache
System: Linux cl1170g 4.19.62-mod-std-ipv6-64-rescue #828825 SMP Tue Jul 30 13:54:49 UTC 2019 x86_64
User: wh0f20bb (1057)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //proc/thread-self/root/root/webmin-1.881/WebminUI/Multiline.pm
package WebminUI::Multiline;
use WebminUI::Textarea;
use WebminCore;
@ISA = ( "WebminUI::Textarea" );

=head2 new WebminUI::Multiline(name, &lines, rows, cols, [disabled])
Create a new input for entering multiple text entries. By default, just uses
a textbox
=cut
sub new
{
if (defined(&WebminUI::Theme::Multiline::new)) {
        return new WebminUI::Theme::Multiline(@_[1..$#_]);
        }
my ($self, $name, $lines, $rows, $cols, $wrap, $disabled) = @_;
$self = new WebminUI::Textarea($name, join("\n", @$lines), $rows, $cols, undef, $disabled);
bless($self);
return $self;
}

=head2 set_lines(&lines)
Sets the lines to display
=cut
sub set_lines
{
my ($self, $lines) = @_;
$self->set_value(join("\n", @$lines));
}

=head2 get_lines()
Returns an array ref of lines to display
=cut
sub get_lines
{
my ($self) = @_;
return [ split(/[\r|\n]+/, $self->get_value()) ];
}

1;